1838648 Members
2816 Online
110128 Solutions
New Discussion

Re: Routeing problem

 
SOLVED
Go to solution
SANTOSH S. MHASKAR
Trusted Contributor

Routeing problem

Hi,

I have configured 2 LAN cards on my system

ifconfig lan0;ifconfig lan1
lan0: flags=1843
inet 10.22.28.93 netmask ffffff00 broadcast 10.22.28.255
lan1: flags=1843
inet 10.22.185.3 netmask fffffff8 broadcast 10.22.185.7

lan0 is for local access and lan1 is for remote access.
my routeing tables r as below

[root@wfms2] #netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
10.22.28.93 10.22.28.93 UH 0 lan0 4136
10.22.185.3 10.22.185.3 UH 0 lan1 4136
10.22.185.0 10.22.185.3 U 2 lan1 1500
10.22.28.0 10.22.28.93 U 2 lan0 1500
127.0.0.0 127.0.0.1 U 0 lo0 0
default 10.22.185.1 UG 0 lan1 0
default 10.22.28.200 UG 0 lan0 0

of which the default route 10.22.185.1, I have added manually.

before adding this route I can traceroute to 2 hosts on my network

[root@wfms2] #traceroute 10.22.73.1;traceroute 10.22.73.11
traceroute to 10.22.73.1 (10.22.73.1), 30 hops max, 40 byte packets
1 10.22.28.200 (10.22.28.200) 0.570 ms 0.419 ms 0.400 ms
2 10.23.139.2 (10.23.139.2) 6.471 ms 10.443 ms 18.191 ms
3 nb1tr.com (10.22.73.1) 28.362 ms 33.474 ms 19.357 ms
traceroute to 10.22.73.11 (10.22.73.11), 30 hops max, 40 byte packets
1 10.22.28.200 (10.22.28.200) 0.519 ms 0.337 ms 0.359 ms
2 10.23.139.2 (10.23.139.2) 14.947 ms 4.492 ms 4.396 ms
3 e2tr.com (10.22.73.11) 4.247 ms 4.491 ms 4.483 ms

but after adding default route 10.22.185.1 sometimes I cannot traceroute 10.22.73.1,
the route for 10.22.73.1 takes a path from
default route 10.22.185.1 and connot get the destination 10.22.73.1,

[root@wfms2] #traceroute 10.22.73.1
traceroute to 10.22.73.1 (10.22.73.1), 30 hops max, 40 byte packets
1 dfmsrtr (10.22.185.1) 0.489 ms 0.444 ms 0.318 ms

but at the same time if I traceroute 10.22.73.11
the route takes path from default route 10.22.28.200 and get the destination 10.22.73.11.

[root@wfms2] #traceroute 10.22.73.11
traceroute to 10.22.73.11 (10.22.73.11), 30 hops max, 40 byte packets
1 10.22.28.200 (10.22.28.200) 0.514 ms 0.341 ms 0.483 ms
2 10.23.139.2 (10.23.139.2) 4.418 ms 4.342 ms 6.187 ms
3 e2tr.com (10.22.73.11) 6.429 ms 4.135 ms 4.331 ms

this means someof packets goes to 1 default route and some to other how is it possible since the network for both hosts is same (10.22.73.0)?

Can somebody tell how to avoid local packets to go to gateway 10.22.185.1 ?

- Santosh

13 REPLIES 13
Muthukumar_5
Honored Contributor

Re: Routeing problem

Suggesting to have only one default gateway if yo u have more lan cards. Else it will make problem like this. Packets will check the default gateway if it is not having any routing. If you have more gateway as default then selection continuing here itself too.

Use any one of them as default gw.

--
Muthu
Easy to suggest when don't know about the problem!
Senthil Kumar .A_1
Honored Contributor

Re: Routeing problem

Hi,

Having 2 GW's is not a supported config, not only in HPUX even in general networking unless used for load balancing. If load balancing is concerned, that is the job of network routers and not HPUX servers.

you need to remove the second default Gateway setting and configure "10.22.28.200" as a route to specific networks using "route add net" command. Consult man page of "route" to get more details.

http://docs.hp.com/en/B2355-60127/route.1M.html

If you want to make the "route" entry permanent, add the etries to "/etc/rc.config.d/netconf" file.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
SANTOSH S. MHASKAR
Trusted Contributor

Re: Routeing problem

Yes I agree that creating 2 default gateways is
not a good idea but if I don't create the default gateway 10.22.185.1 the remote users
r not able to access my system .

Muthukumar_5
Honored Contributor

Re: Routeing problem

> if I don't create the default gateway 10.22.185.1 the remote users r not able to access my system
>>>

Then try to add the routing for remote network machines with 10.22.185.1 gateway. Problem will be solved.

Use route add net <...> syntax to add new network. See man route page.

--
Muthu
Easy to suggest when don't know about the problem!
Senthil Kumar .A_1
Honored Contributor

Re: Routeing problem

Hi,

Give us the subnet mask and network address part of your Remote users, We will give you the exact syntax to add a route using "route" command.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Patrice Le Guyader
Respected Contributor

Re: Routeing problem

Hi,

What you can do is a :
route -f
this will clear the gateway and after you can add your default gateway manually. Once it's ok you can add it in /et/rc.config.d/netconf. You should already have one which seems not to be good.

Hope this help
Pat.
Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
SANTOSH S. MHASKAR
Trusted Contributor

Re: Routeing problem

Dear Senthil,

The netmask is 255.255.255.248 and remote network is 91.20.1.0,

If is add a route for this using

[root@wfms2] #route add net 91.20.1.0 10.22.185.1 255.255.255.248
add net 91.20.1.0: gateway 10.22.185.1

My routing table shows

[root@wfms2] #netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
10.22.28.93 10.22.28.93 UH 0 lan0 4136
10.22.185.3 10.22.185.3 UH 0 lan1 4136
10.22.185.0 10.22.185.3 U 2 lan1 1500
10.22.28.0 10.22.28.93 U 2 lan0 1500
91.0.0.0 10.22.185.1 UG 0 lan1 0
127.0.0.0 127.0.0.1 U 0 lo0 0
default 10.22.28.200 UG 0 lan0 0


How a route for 91.0.0.0 is added instead of 91.20.1.0 ? Pl. explain.

-Santosh
Muthukumar_5
Honored Contributor

Re: Routeing problem

91.0.0.0 10.22.185.1 UG 0 lan1 0

Is a wrong entry i hope. Try to remove that as,

# route delete net 91.0.0.0 10.22.185.1 1

Try to add now as,

# route add net 91.20.1.0 netmask 255.255.255.248 10.22.185.1

what are you getting from netstat -rn now.

Try after this.

--
Muthu
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: Routeing problem

Is there anything in /etc/rc.config.d/netconf file regarding this 91.0.0.0 10.22.185.1 UG 0 lan1 0 entry. Check that.

Anyway after successful setting of routing try to update in netconf file as well.

--
Muthu
Easy to suggest when don't know about the problem!
SANTOSH S. MHASKAR
Trusted Contributor

Re: Routeing problem

Hi Muthu,

I tried as u suggested but got error.

[root@wfms2] #route add net 91.20.1.0 netmask 255.255.255.248 10.22.185.1
add net 91.20.1.0: gateway 10.22.185.1: Network is unreachable

Also in netconf there is not any entry regarding 91.0.0.0

-Santosh
Muthukumar_5
Honored Contributor
Solution

Re: Routeing problem

Try as,

# route add net 91.20.1.0 netmask 255.255.255.248 10.22.185.1 1

or

# route add net 91.20.1.0 10.22.185.1

Ping to any other machine in 91.20.1.x network.

--
Muthu
Easy to suggest when don't know about the problem!
SANTOSH S. MHASKAR
Trusted Contributor

Re: Routeing problem

Hi,

Thanks all of u.

The issue is resolved, the subnet mask of network 91.22.1.0 is 255.255.0.0 ,

I added route as below,

[root@wfms2] #route add net 91.20.0.0 netmask 255.255.0.0 10.22.185.1 1
add net 91.20.0.0: gateway 10.22.185.1
[root@wfms2] #netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
10.22.28.93 10.22.28.93 UH 0 lan0 4136
10.22.185.3 10.22.185.3 UH 0 lan1 4136
10.22.185.0 10.22.185.3 U 2 lan1 1500
10.22.28.0 10.22.28.93 U 2 lan0 1500
91.20.0.0 10.22.185.1 UG 0 lan1 0
127.0.0.0 127.0.0.1 U 0 lo0 0
default 10.22.28.200 UG 0 lan0 0
[root@wfms2] #traceroute 91.20.1.109
traceroute to 91.20.1.109 (91.20.1.109), 30 hops max, 40 byte packets
1 dfmsrtr (10.22.185.1) 0.466 ms 0.371 ms 0.347 ms
2 192.168.2.1 (192.168.2.1) 42.635 ms 42.736 ms 42.636 ms
3 91.20.1.109 (91.20.1.109) 44.587 ms 44.336 ms 44.449 ms
[root@wfms2] #traceroute 91.22.38.1
traceroute to 91.22.38.1 (91.22.38.1), 30 hops max, 40 byte packets
1 10.22.28.200 (10.22.28.200) 0.412 ms 0.380 ms 0.358 ms
2 10.23.139.14 (10.23.139.14) 5.109 ms 3.317 ms 3.276 ms
3 91.22.38.1 (91.22.38.1) 3.644 ms 3.581 ms 3.655 ms


Thanks all of u.

-Santosh
SANTOSH S. MHASKAR
Trusted Contributor

Re: Routeing problem

Got the solution and problem is solved.
Thanks all of u.

-Santosh