Operating System - HP-UX
1819902 Members
2154 Online
109607 Solutions
New Discussion юеВ

Re: Routing IP and Default GW are same

 
Dhananjaya Amarakoon
Regular Advisor

Routing IP and Default GW are same

Hi All,

I have a HP-UX server which have routing table as follows.
See attached file.

My Problem is earlier default gw was 192.168.10.100 but recently it changed to 192.168.10.2 which all other routing entries are routed.

So due to both are same, I removed all other network routing entries and kept only default gw.
then all the communications were lost to other network.

I am wondering how that was happen ? Server is using one lan card which is IP 192.168.10.7

Can some one has idea about this incident ?

Dhananjaya


13 REPLIES 13
johnsonpk
Honored Contributor

Re: Routing IP and Default GW are same

>>
So due to both are same,(what are they ??) I removed all other network routing entries and kept only default gw.
then all the communications were lost to other network. (which network/subnet ??)

do you have copy of your old routing table ??

regards!
Johnson
Dhananjaya Amarakoon
Regular Advisor

Re: Routing IP and Default GW are same

Hi Johnsan

Both mean default gateway ( 192.168.10.2 ) and Gateway (192.168.10.2) for other routing entries.
We experienced lost communication for 192.168.8.0 network due to it located inside head office. Others are branched networks.
I suddenly revert back entries without second thought.

The different between old routing table is default gw which was 192.168.10.100

Dhananjaya
johnsonpk
Honored Contributor

Re: Routing IP and Default GW are same

You mean to say that ..the network 192.168.8.0 is reachable through gateway 192.168.10.100 and not through 192.168.10.2 ?
V. Nyga
Honored Contributor

Re: Routing IP and Default GW are same

Hi,

all your destinations begin with 192.168.x.x
I would suggest that you change your subnet mask to 255.255.0.0
Check your /etc/rc.config.d/netconf I believe your is:
SUBNET_MASK[0]=255.255.255.0
Change it to:
SUBNET_MASK[0]=255.255.0.0

Then you don't need to add a route to every subnet.

HTH
V.
*** Say 'Thanks' with Kudos ***
Dhananjaya Amarakoon
Regular Advisor

Re: Routing IP and Default GW are same


What I mean 192.168.8.0 is reachable because of following entry
192.168.8.0 192.168.10.2 UG 0 lan0 1500

Wht I did remove above entry (including all other routing entries) and keep following entry which is default routing entry

default 192.168.10.2 UG 0 lan0 1500


that time 192.168.8.0 is unreachable. ( I did this because by thinking now all unknown (including 192.168.8.0) data packets should routed to 192.168.10.2 )
Earlier also above 1 st entry was there. what happened I changed default gateway to 192.168.10.2


Yes, subnet mask are as 255.255.255.0. But my problem is why that packets are not routing via default gateway?
V. Nyga
Honored Contributor

Re: Routing IP and Default GW are same

Hi again,

with your default
>default 192.168.10.2 UG 0 lan0 1500
and subnet mask
255.255.255.0

you can reach all ip-addresses with
192.168.10.x
Because of this now 192.168.8.0 is unreachable.
192.168.10.2 can only reach 192.168.10.x!

HTH
V.

*** Say 'Thanks' with Kudos ***
Dhananjaya Amarakoon
Regular Advisor

Re: Routing IP and Default GW are same

Hi
Ok, then what you think about following entry
192.168.8.0 192.168.10.2 UG 0 lan0 1500

If I remove above entry communication with 192.168.8.0 network will be lost.
but u can see above network gateway also 192.168.10.2 which is separate network id.

I hope 192.168.10.2 is a interface IP of firewall or router may internally route to other networks.

Dhananjaya
V. Nyga
Honored Contributor

Re: Routing IP and Default GW are same

Ok, sorry, your ip is 192.168.10.7, so you can reach 192.168.10.x

So you can reach your router: 192.168.10.2

You think, with:
default 192.168.10.2 UG 0 lan0 1500
you can reach any network?

It's logical, but it seems like it doesn't work:
>Ok, then what you think about following entry
>192.168.8.0 192.168.10.2 UG 0 lan0 1500
>If I remove above entry communication with
>192.168.8.0 network will be lost.

>I hope 192.168.10.2 is a interface IP of
>firewall or router may internally route to other networks.

Yes, it's a router, but you have to say your system which ip-addresses it can reach with this router - 'default' seems not to work.

Can you give us your:
/etc/rc.config.d/netconf ?

V.
*** Say 'Thanks' with Kudos ***
V. Nyga
Honored Contributor

Re: Routing IP and Default GW are same

>Yes, it's a router, but you have to say
>your system which ip-addresses it can reach
>with this router - 'default' seems not to work.

Or your ROUTE_MASK in /etc/rc.config.d/netconf is not set correct ...

V.
*** Say 'Thanks' with Kudos ***
Dhananjaya Amarakoon
Regular Advisor

Re: Routing IP and Default GW are same

Hi
This is one of customer place, I have some limitation to do testing.

Yes, I agree with u, logically It should work.
If default gateway IP is not working ( 192.168.10.2) which is same to gateway for other network how communication will lost if I remove other routing entries.

I will put some entries of netconf file ( because of this open forum I have some limits )



HOSTNAME="XXXX"
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1

INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]="192.168.10.7"
SUBNET_MASK[0]="255.255.255.0"
BROADCAST_ADDRESS[0]="192.168.10.255"
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0
INTERFACE_MODULES[0]=""


ROUTE_DESTINATION[0]=default
#ROUTE_DESTINATION[0]=192.168.10.0
ROUTE_MASK[0]="255.255.255.0"
ROUTE_GATEWAY[0]="192.168.10.2"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

ROUTE_DESTINATION[1]=192.168.11.0
ROUTE_MASK[1]="255.255.255.0"
ROUTE_GATEWAY[1]="192.168.10.2"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""


ROUTE_DESTINATION[35]=192.168.8.0
ROUTE_MASK[35]="255.255.255.0"
ROUTE_GATEWAY[35]="192.168.10.2"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

ROUTE_DESTINATION[2]=192.168.12.0
ROUTE_MASK[2]="255.255.255.0"
ROUTE_GATEWAY[2]="192.168.10.2"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

-------

ROUTE_DESTINATION[22]=192.168.30.0
ROUTE_MASK[22]="255.255.255.0"
ROUTE_GATEWAY[22]="192.168.10.2"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

# Dynamic routing daemon configuration. See gated(1m)
#
# GATED: Set to 1 to start gated daemon.
# GATED_ARGS: Arguments to the gated daemon.

GATED=0
GATED_ARGS=""

#
# Router Discover Protocol daemon configuration. See rdpd(1m)
#
# RDPD: Set to 1 to start rdpd daemon
#

RDPD=0

#
# Reverse ARP daemon configuration. See rarpd(1m)
#
# RARPD: Set to 1 to start rarpd daemon
#

RARPD=0


DEFAULT_INTERFACE_MODULES=""





V. Nyga
Honored Contributor

Re: Routing IP and Default GW are same

Hi again,

so this is your actual configuration?

ROUTE_DESTINATION[0]=default
#ROUTE_DESTINATION[0]=192.168.10.0
ROUTE_MASK[0]="255.255.255.0"
ROUTE_GATEWAY[0]="192.168.10.2"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

ROUTE_DESTINATION[35]=192.168.8.0
ROUTE_MASK[35]="255.255.255.0"
ROUTE_GATEWAY[35]="192.168.10.2"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

and you don't get a connection to 192.168.8.0?
Have you done it yourself or was it already there?

Please test either:
ROUTE_DESTINATION[0]=default
ROUTE_MASK[0]="255.255.0.0" <- as I mentioned above

or:
ROUTE_DESTINATION[35]="net 192.168.8.0"
ROUTE_MASK[35]="255.255.255.0"

HTH
V.
*** Say 'Thanks' with Kudos ***
Dhananjaya Amarakoon
Regular Advisor

Re: Routing IP and Default GW are same

Hi

Yes, this is actual configuration.
Yes I get connection to the 192.168.8.0 network due to following block.
>
ROUTE_DESTINATION[35]=192.168.8.0
ROUTE_MASK[35]="255.255.255.0"
ROUTE_GATEWAY[35]="192.168.10.2"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""
>

If I removed above block communication will lost.
But Why I am confuse even above block is removed , 192.168.8.0 network should access via default gateway ( According to my knowledge )
Yes. I will try but it take times due it production

Dhananjaya
V. Nyga
Honored Contributor

Re: Routing IP and Default GW are same

Hi again,

>If I removed above block communication will lost.
>But Why I am confuse even above block is removed,
>192.168.8.0 network should access via default gateway
>( According to my knowledge )

ROUTE_MASK[0]="255.255.255.0" is the limitation, as long as you don't change it you'll still limitated to
ROUTE_DESTINATION[0]=192.168.10.0

Also this makes no sense:
You can see it in your current Routing tables:
Destination Gateway 192.168.10.7 192.168.10.7 192.168.10.0 192.168.10.7

You can reach any 192.168.10.x with your server. That's because:
INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]="192.168.10.7"
SUBNET_MASK[0]="255.255.255.0"
BROADCAST_ADDRESS[0]="192.168.10.255"

It's a part of security to limit this!
An admin before you had made this, and he opened only those destinations he wanted.
Because of this you have so many entires in netconf.

If you don't want this limitation you can also do:
INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]="192.168.10.7"
SUBNET_MASK[0]="255.255.0.0" <- change
BROADCAST_ADDRESS[0]="192.168.255.255" <- change
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0
INTERFACE_MODULES[0]=""

Then you don't need any route to 192.168.x.x

>Yes. I will try but it take times due it production

Haven't you tested already some things at your production server?

V.
*** Say 'Thanks' with Kudos ***