1830241 Members
5107 Online
109999 Solutions
New Discussion

netconf question

 
Jimbo04
Occasional Contributor

netconf question

I have tree nics, two are in the network (10.151.1.0/24 gateway=10.151.1.254) and the other in the network (192.168.3.0/24 gateway=192.168.3.254).
I have a router for subnet, How i can that the second gateway=192.168.3.254 work?
This netconf is right?

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

INTERFACE_NAME[0]="lan4"
IP_ADDRESS[0]="10.151.1.10"
SUBNET_MASK[0]=255.255.255.0
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]="up"
DHCP_ENABLE[0]=0

INTERFACE_NAME[1]=lan4
IP_ADDRESS[1]=10.151.1.11
SUBNET_MASK[1]=255.255.255.0
BROADCAST_ADDRESS[1]=10.151.1.255
INTERFACE_STATE[1]=up
DHCP_ENABLE[1]=0

ROUTE_DESTINATION[0]=default
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]=10.151.1.254
ROUTE_COUNT[0]=1
ROUTE_ARGS[0]=""

ROUTE_DESTINATION[1]=default
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]=192.168.3.254
ROUTE_COUNT[1]=1
ROUTE_ARGS[1]=""


Thanks for the help


3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: netconf question

I don't think you can have two default gateways.

I would change....

ROUTE_DESTINATION[1]=default
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]=192.168.3.254
ROUTE_COUNT[1]=1
ROUTE_ARGS[1]=""

to:

ROUTE_DESTINATION[1]=192.168.3.0
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]=192.168.3.254
ROUTE_COUNT[1]=1
ROUTE_ARGS[1]=""

I'm not sure on that destination, but I know I would not want a system confused with two default gateways.

I might be wrong, remember trying to do this once on the command line and the default gateway kept changing.

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
Jimbo04
Occasional Contributor

Re: netconf question

Thanks Stevens.
I try your configuratoion but the idea is that the two routers work at the same time because they point to diferent networks.
Then the asignamet.
Con O'Kelly
Honored Contributor

Re: netconf question

Hi

It is fairly straight forward to add multiple routes, however as Steven said you cannot have 2 default gateways. The normal setup is to have 1 default gateway where all traffic that is not destined for your local network is sent.
If you have multiple NICs you can configure additional routes.

Let's assume you use 10.151.1.254 as your default gateway so that all traffic not destined for 10.151.1.0 or 192.168.3.0 network will be sent to the 10.151.1.254 gateway.
You netconf entry should be as follows:
ROUTE_DESTINATION[0]=default
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]=10.151.1.254
ROUTE_COUNT[0]=1
ROUTE_ARGS[0]=""

Now suppose you want to add a route to the 192.168.2.0 network that is reachable from the 192.168.3.254 gateway, you would add another entry to netconf as follows:
ROUTE_DESTINATION[1]="net 192.168.2.0"
ROUTE_MASK[1]="255.255.255.0"
ROUTE_GATEWAY[1]=192.168.3.254
ROUTE_COUNT[1]=1
ROUTE_ARGS[1]=""

You can add multiple routes to different networks in this way but it does get complicated. It is far simpler to use one default gateway where all non local network traffic is forwarded and for that gateway to have the rules in place to be able to forward all traffic to the relevant network.

Cheers
Con