Operating System - HP-UX
1833847 Members
2128 Online
110063 Solutions
New Discussion

Unwanted Route Added when using ifconfig

 
SOLVED
Go to solution
Ty Roberts
Frequent Advisor

Unwanted Route Added when using ifconfig

We are doing some testing with seperating out specific network traffic between 2 network cards on the same subnet (I know that this may not be "best practice" but please bear with me).

This is our routing table before we bring up the "testing" network card:

wcores06 [/root]
# netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
10.10.102.71 10.10.102.71 UH 0 lan2 4136
10.10.0.82 10.10.0.82 UH 0 lan1 4136
10.10.6.200 10.10.6.200 UH 0 lan1:1 4136
192.168.100.6 192.168.100.6 UH 0 lan0 4136
10.10.0.0 10.10.0.82 U 3 lan1 1500
10.10.0.0 10.10.6.200 U 3 lan1:1 1500
192.168.0.0 192.168.100.6 U 2 lan0 1500
127.0.0.0 127.0.0.1 U 0 lo0 0
default 10.10.0.1 UG 0 lan1 0

When we bring up lan2 (the testing card) it places a route to 10.10.0.0 going through lan2 as you can see below:
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
10.10.102.71 10.10.102.71 UH 0 lan2 4136
10.10.0.82 10.10.0.82 UH 0 lan1 4136
10.10.6.200 10.10.6.200 UH 0 lan1:1 4136
192.168.100.6 192.168.100.6 UH 0 lan0 4136
10.10.0.0 10.10.102.71 U 2 lan2 1500
10.10.0.0 10.10.0.82 U 3 lan1 1500
10.10.0.0 10.10.6.200 U 3 lan1:1 1500
192.168.0.0 192.168.100.6 U 2 lan0 1500
127.0.0.0 127.0.0.1 U 0 lo0 0
default 10.10.0.1 UG 0 lan1 0

Since this is added as a higher priority then lan1 all network traffic goes out of lan2 and it messes with some applications like NIS.

Is there a way to specify with ifconfig (or anything else) to have this route added with a lower priority or not at all??

Thanks,
Ty
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Unwanted Route Added when using ifconfig

With ifconfig, you can specify a gateway. That might alter your results a bit.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Thorsteinson
Honored Contributor
Solution

Re: Unwanted Route Added when using ifconfig

I had a similar problem. Two cards on the
same subnet. One to handle local traffic,
and the other remote traffic.

The resultion that worked for me was to define
the subnet for the traffic handling local
traffic to be smaller than the subnet
for the other card.

The matching algorithm uses the route with the
most number of bits in the mask. Don't try
to route the same subnet through both cards.
It doesn't work. Use more specific subnets.
You can nest a smaller subnet inside another.
Torsten.
Acclaimed Contributor

Re: Unwanted Route Added when using ifconfig

If you configure 2 NICs in 1 system on the same subnet you will have a lot of trouble.
This can't work at all.
You have to use different subnets!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Matthew_50
Valued Contributor

Re: Unwanted Route Added when using ifconfig

try to use the command /etc/route to add or delete the entry

route [-f] [-n] [-p pmtu] add [net|host] destination [netmask mask] gateway [count]

route [-f] [-n] delete [net|host] destination
[netmask mask] gateway [count]
Ty Roberts
Frequent Advisor

Re: Unwanted Route Added when using ifconfig

Bill, your solution got me exactly what I was looking for. Thanks so much everyone for their input.