1824245 Members
3849 Online
109669 Solutions
New Discussion юеВ

Routing Issue

 
SOLVED
Go to solution
Paul McCleary
Honored Contributor

Routing Issue


Hi,

I am very rusty at networking, partially because I avoid it as I dislike it so much. So can anyone help with the relatively simple issue I have below?

We have a system with 2 NICs

lan0: 10.1.1.10
lan1: 10.1.2.10
with masks of 255.255.255.0

The default route is 10.1.1.1

There is a second gateway of 10.1.2.1 that we want to route all 10.122.0.0 and 10.1.3.0 traffic to.

What is the best way of achieving this?

I vaguely remember that even though from 11 on you can have 2 default gateways, the second will always remain down until the 1st fails - so that is not the approach I need. I'm fairly sure we need to set some routes in the netconf, though this has been tried with the syntax below which I think looks OK.

ROUTE_GATEWAY[0]=10.1.1.1
ROUTE_COUNT[0]=1
ROUTE_DESTINATION[0]=default
ROUTE_DESTINATION[1]="net 10.122.0.0"
ROUTE_MASK[1]=255.255.0.0
INTERFACE_NAME[1]=lan1
INTERFACE_STATE[1]=up
ROUTE_GATEWAY[1]=10.1.2.1

Can anyone spot the error (I'm sure it's probably obvious!)

Cheers, Paul
6 REPLIES 6
Joaquin Gil de Vergara
Respected Contributor

Re: Routing Issue

you must to add another entry in netconf

ROUTE_DESTINATION[2]="net 10.1.3.0"
ROUTE_MASK[2]=255.255.255.0
ROUTE_GATEWAY[2]=10.1.2.1


then flush your routing table and restart network

# /sbin/init.d/net stop
# route -f
# /sbin/init.d/net start

you must have icmp connection against both router, in other way net will be fail

best way to have two default gateways is forget static routes and enabling a dinamic routing protocol like ospf or rip (see man pages for gated)



Teach is the best way to learn
Paul McCleary
Honored Contributor

Re: Routing Issue


Thanks.

I realise the second 10.1.3.0 route is not added above. We couldn't get the first one working, so we hadn't bothered trying the other one.

What you're suggesting is virtually identical to what we have tried. Any other ideas?

Thanks Anyway, Paul
Joaquin Gil de Vergara
Respected Contributor

Re: Routing Issue

try to leave the first like this

ROUTE_DESTINATION[1]="net 10.122.0.0"
ROUTE_MASK[1]=255.255.0.0
ROUTE_GATEWAY[1]=10.1.2.1

and restart

do you have ping to two routers? try it!
Teach is the best way to learn
Darrell Allen
Honored Contributor
Solution

Re: Routing Issue

Hi Paul,

Your netconf seems incomplete and looks as though you are entertwining options for interfaces and routes. You need to define both interfaces, the default route, and 2 static routes. I think the following should work.

INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=10.1.1.10
SUBNET_MASK[0]="255.255.255.0"
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0

INTERFACE_NAME[1]=lan1
IP_ADDRESS[1]=10.1.2.10
SUBNET_MASK[1]=255.255.255.0
BROADCAST_ADDRESS[1]=""
INTERFACE_STATE[1]=""
DHCP_ENABLE[1]=0

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

ROUTE_DESTINATION[1]="net 10.122.0.0"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]=10.1.2.1
ROUTE_COUNT[1]=1
ROUTE_ARGS[1]=""

ROUTE_DESTINATION[2]="net 10.1.3.0"
ROUTE_MASK[2]=""
ROUTE_GATEWAY[2]=10.1.2.1
ROUTE_COUNT[2]=1
ROUTE_ARGS[2]=""

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Darrell Allen
Honored Contributor

Re: Routing Issue

By the way, the problem with the route for "net 10.122.0.0" is you do not have ROUTE_COUNT (which needs to be 1 since the gateway address is not on the local serverbut is instead a router's address).

It is much easier to read netconf if you format it as I have in my previous reply.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Paul McCleary
Honored Contributor

Re: Routing Issue

Thanks for your efforts Darrell and Joaquin.

Darrell apart from having to add the netmasks your suggestion worked a treat. I'm confident it was the missing route count that was causing the issue as the gateway is not local to the host.

Thanks again, Paul