Operating System - HP-UX
1827701 Members
3010 Online
109967 Solutions
New Discussion

weired question about routing by interfaces

 
SOLVED
Go to solution
Johannes Kaiser
New Member

weired question about routing by interfaces

Hello,

we've got a server with two interfaces, which are connected to the same network, but different subnets.

How can I configure it, that my server contacts a network (or host address) by using a specific INTERFACE for outgoing traffic?

for example:

users are contacting my server throung first interface (lan1), but my server initates the backup itself over the second interface (lan2). At present the second interface is not used for any outgoing traffic. So all the data is using interface "lan1", which makes the "user network" very busy.

Can anyone help me out?

Thank you.

Hannes.

Never say never!
5 REPLIES 5
James Beamish-White
Trusted Contributor

Re: weired question about routing by interfaces

I don't know whether this would work, but you could try...

1. Down the interface you don't want to use for a specific subnet.
2. Ping (or otherwise initiate a network connection to) the specific host.
3. Bring up the other interface.

Otherwise, I have no idea ;-)

Cheers,
James
GARDENOFEDEN> create light
Jeff Schussele
Honored Contributor
Solution

Re: weired question about routing by interfaces

Hi Johannes,

You need to set up a static route thru that NIC - either for the second subnet as a whole (multiple hosts) or to a specific host.

Use the route command - EX:

route add host ip_of_host ip_of_NIC

OR

route add net subnet_ip ip_of_NIC

Do a man route for further details.
You'll want to make entries in the /etc/rc.config.d/netconf file to have this route active at boot time.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
pap
Respected Contributor

Re: weired question about routing by interfaces

Hi ,
I think you can do it by defining dtwo route entries in your /etc/rc.config.d/netconf file.

For outgoing traffic you can give default route through the LAN card you want to.

-Pap.
"Winners don't do different things , they do things differently"
Paul R. Dittrich
Esteemed Contributor

Re: weired question about routing by interfaces

If you add a "host" route instead of a "net" route, you can force the traffic to use whichever gateway you specify.

HTH,
Paul
MAD_2
Super Advisor

Re: weired question about routing by interfaces

About this subject, I have basically the same issue. Can someone clear up a question I have about /etc/r.config.d/netconf

To make all outbound traffic go on the fastest card (let's assume a 1000Base-T card uses xxx.xx.xx.01 IP while xxx.xx.xx.02 is a Fast Ethernet), would prescedence here make this happen? By the way, in my netconf file, the only IP appering under the Internet Configuration parameters is the Fast Ethernet; the 1000Base-T is included under reverse ARP

Inside netconf...
# Internet configuration parameters. See ifconfig(1m), autopush(1m)
# For each additional network interfaces, add a set of variable assignments
# like the ones below, changing the index to "[1]", "[2]" et cetera.
#
INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=xxx.xx.xx.02
SUBNET_MASK[0]=255.255.254.0
BROADCAST_ADDRESS[0]=xx.xxx.xxx.255
INTERFACE_STATE[0]=up
DHCP_ENABLE[0]=0

#Here is my question???
#INTERFACE_NAME[1]=lan1
#IP_ADDRESS[1]=xxx.xx.xx.01
#SUBNET_MASK[0]=255.255.254.0
#BROADCAST_ADDRESS[0]=xx.xxx.xxx.255
#INTERFACE_STATE[0]=up
#DHCP_ENABLE[0]=0


#
# 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)
#
# RARP: Set to 1 to start rarpd daemon
#
RARP=0
IP_ADDRESS[1]=xxx.xx.xx.01
SUBNET_MASK[1]=255.255.254.0
INTERFACE_NAME[1]=lan1
BROADCAST_ADDRESS[1]=xxx.xx.xx.255
INTERFACE_STATE[1]=up
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with