1833094 Members
3354 Online
110050 Solutions
New Discussion

route add default

 
Coolmar
Esteemed Contributor

route add default

When I try and add my default route, I get "network unreachable". I can ping the gateway server.

Netstat -r

Routing tables
Destination Gateway Flags Refs Interface Pmtu
localhost localhost UH 0 lo0 4136
10.187.25.203 161.187.25.203 UH 0 lan0 4136
cipo-ux4 server4 UH 0 lan1 4136
10.187.25.0 server4 U 2 lan1 1500
loopback localhost U 0 lo0 0


route add default 10.187.25.254
8 REPLIES 8
Sandman!
Honored Contributor

Re: route add default

Need to specify the route count which is > 0 for destinations that use an intermediate gateway so change your route add to and add those entries to /etc/rc.config.d/netconf in order to survive a reboot:

# route add default 10.187.25.25 1
Coolmar
Esteemed Contributor

Re: route add default

I tried that as well and it didn't work.
Geoff Wild
Honored Contributor

Re: route add default

Try:

route add default gateway 10.187.25.254

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Geoff Wild
Honored Contributor

Re: route add default

Or just add to /etc/rc.config.d/netconf

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


And restart networking:

/sbin/init.d/net stop ; /sbin/init.d/net start

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Coolmar
Esteemed Contributor

Re: route add default

It is in the netconf already.
Sandman!
Honored Contributor

Re: route add default

Could you post the output of the following command:

# netstat -rnv
Coolmar
Esteemed Contributor

Re: route add default

reboot fixed it...
Geoff Wild
Honored Contributor

Re: route add default

What subnet mask are you using?

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.