Operating System - HP-UX
1833151 Members
3689 Online
110051 Solutions
New Discussion

Two n/w cards on same server and same network

 
SOLVED
Go to solution
Richard Quinn
Occasional Advisor

Two n/w cards on same server and same network

Hi,
I have two network cards installed in a K box here. There is only one network so no subnetting involved (netmask 255.255.0.0).
lan0 is a bog-standard ethernet 10mb/s card and lan1 is a 100 baseT card. Is it possible to configure this so that all the routing goes through lan1 ?
I can do this after booting the server by deleting the route that directs traffic through lan0 but I can't make this configuration change stick (i.e. it disappears after I boot the server).
I've played around with the netconf file quite a lot and can't make this happen.
The problem seems to be since there are two cards on the same network then it automatically creates a route to the local network on startup. However, for some reason it then chooses to route all traffic through lan0.
Is there any way I can do this wile having both cards 'alive' ?

thanks

Richard.
7 REPLIES 7
Gadura Praveen
Frequent Advisor

Re: Two n/w cards on same server and same network

Hello Richard,

It may be not the cleanest way to do this , but you can write a script to execute the route delete command (for lan0) in run-level 3 or 4.

Praveen
Peter Van Sant
Advisor

Re: Two n/w cards on same server and same network

Since IP is a connection-less protocol, each IP datagram is routed seperatly from all other datagrams. This means that each outbound datagram is treated as unrelated to any other datagram so there is no such thing as a "reply".

The way IP routing works on hp-ux (and many other systems) can be called "interface based routing". When an interface is assigned an IP address and netmask, IP "figures out" what network we are attached to via that interface. This is sort of like saying that if the address on my front door is 100 Main St., then any address on Main Street must be out my front door.

Now when IP has an outbound datagram to deliver, it looks at the destination IP address and then looks in it's routing tables to find "the best" route to get to that destination. It searches in the following order:


An exact "host route" (exact match with the "H" flag set)
The most exact match for a network route
The default gateway.
Number two "most exact match" is currently defined as the destination that with the most bits. If I am sending to IP address 1.2.3.4 and I have two destinations listed such as:

Destination Gateway ... 1.2 xxx 1.2.3 xxx

I will find that "1.2.3" (24 bits match) is a better or more specific match than is "1.2" (16 bits match). So IP will always choose the second route for this particular destination.

Now, if I have two interfaces on the same subnet, then I have two identical destinations in the routing table and I will try to find the "best" match. In such a case, I have no way of knowing which interface is "better" since they both lead to exactly the same subnet. In such a case IP will always pick the same route and all traffic for the target network/IP will always use the same interface.

I early BSD implementations the IP code would actually keep a use count on routes and find all equal routes and then use the one with the lowest use count. This is NOT the case in versions of HP-UX after about verison 8.0.

It is still possible to have two cards on the same network and different subnets or even to use different subnet masks. We just do not currently support two interfaces in the same subnet. Even if you do this, it may well not do what you expect since all outbound traffic will use the same interface.

Jordan Bean
Honored Contributor

Re: Two n/w cards on same server and same network

We simply don't use the core ethernet interface (lan0) in favor of the fast-ethernet interface (lan1) by setting the interface parameter in netconf to lan1. (I'm not in front of my systems at the moment so I'm working from six-month old memories.)

If we had DTCs, then we'd be forced to use the core ethernet interface since the dtc bootp daemon (for some reason) doesn't bind to interfaces faster than ethernet (unless this has reasonly changed), but we'd put then all on a private subnet.
Tim D Fulford
Honored Contributor
Solution

Re: Two n/w cards on same server and same network

If I understand you correctly you have two network cards on the same subnet. lan0 10BaseT & lan1 100BaseT. You want to make sure the trafic flow through lan1. I expect it is choosing lan0 as it is the first lan on that subnet

1 - get rid of lan0 (do not configur it) & put an IP alias on lan1 with the old IP address.
# ifalias lan1 add
This obviously reduces your net bandwidth by 10%

2 - This is more tricky, swap lan0 & lan1 'round such that lan0 is the 100BaseT & lan1 is 10BaseT. This requires a re-boot as you need to fiddle the instance numbers in the /[stand etc]/ioconfig files.

a) # ioscan -f | awk 'NR>2{print $3, $1, $2}'> /tmp/infile
the infile has the format
h/w class instance#
Only edit the instance number for your lan cards
eg
:
12/16/6 lan 0
10/4/1 lan 1
:
b) edit your /etc/rc.config.d/netconf file appropriately
# vi /etc/rc.config.d/netconf

c) run ioinit, the -r means re-boot
# ioinit -f /tmp/infile -r

This is a bit of a hassle but both should work!

Tim
-
rick jones
Honored Contributor

Re: Two n/w cards on same server and same network

if you are running 11, you can use ndd to set ip_strong_es_model. among other things, it will means that if traffic arrives on interace A, it will go back out on interface A. not _quite_ all traffic going-out the one interface as you ask, but it would leave the other interface present.

as for 10.20, you will have to mess about with the routing tables.

if you went to 100BT for performance, i hope you didn't go with an HP-PB 100BT card. that is at best a 1/2 speed card and it sucks down lots of CPU cycles per packet. hsc would be a much better choice.
there is no rest for the wicked yet the virtuous have no pillows
Richard Quinn
Occasional Advisor

Re: Two n/w cards on same server and same network

Thanks for all the info folks. It's been very helpful.

I'm going to go with Tim's suggestion but there is one issue I'd like to clarify :

The " ioscan -f | awk 'NR>2{print $3, $1, $2}'> /tmp/infile " command puts a device with a blank h/w path in as the first line in the infile.
i.e.
#ioscan -f
Class I H/W Path Driver S/W State H/W Type Description
============================================================================
bc 0 root CLAIMED BUS_NEXUS
bc 1 8 ccio CLAIMED BUS_NEXUS I/O Adapter
bc 2 8/0 bc CLAIMED BUS_NEXUS Bus Converter
disk 1 8/4.8.0 sdisk CLAIMED DEVICE SEAGATE ST34371W
ba 0 8/8 GSCtoPCI CLAIMED BUS_NEXUS PCI Bus Bridge - GSCtoPCI
lan 1 8/8/1/0 btlan4 CLAIMED INTERFACE HP J3516A#001 HSC 10/100Base-TX D-Class 2 port
target 5 8/16/5.7 tgt CLAIMED DEVICE
ctl 1 8/16/5.7.0 sctl CLAIMED DEVICE Initiator
lan 0 8/16/6 lan2 CLAIMED INTERFACE Built-in LAN

this gives an infile with the first few lines like :
root bc 0
8 bc 1
8/0 bc 2
...
8/8/1/0 lan 1
8/16/6 lan 0

Is it safe to just delete the first line and carry on ?

thanks

Richard.
Tim D Fulford
Honored Contributor

Re: Two n/w cards on same server and same network

Sorry for not getting back sooner Ive been away.

Yes is the answer, You positively want to get rid of this first line. Sorry I did not mention it before!

Tim
-