1835485 Members
3521 Online
110078 Solutions
New Discussion

Add route - problem

 
SOLVED
Go to solution
Kenn Chen
Advisor

Add route - problem

I would like to add new IP into my routing table. When i issue the routing command as below, system response that Network not reach and routing was not created. Any idea of this problem ?

route add net 147.174.213.65 netmask 255.255.255.255
Cyber Zen
8 REPLIES 8
Donald Kok
Respected Contributor
Solution

Re: Add route - problem

Hi,
two errors:
147.174.213.65 is not a network, but a host.
255.255.255.255 is not a good netmask.

If you f.i. want to add the 147.174.213 network, you give the command:
route add net 147.174.213.0 netmask 255.255.255.0

Good luck
Donald
My systems are 100% Murphy Compliant. Guaranteed!!!
harry d brown jr
Honored Contributor

Re: Add route - problem

and that is only a temp change. see /etc/rc.config.d/netconf for more perm changes

live free or die
harry
Live Free or Die
Joaquin Gil de Vergara
Respected Contributor

Re: Add route - problem

Donald is right

you also can add a name to the network in the /etc/networks file

mynet 147.174.213

then

route add mynet mask 255.255.255.0

you need put the netmask because 147 is a b class net and by default it takes 16 bit network mask lenght.....

gateway must be reachable by icmp... if not it retunrs an error

regards

Teach is the best way to learn
Darrell Allen
Honored Contributor

Re: Add route - problem

In addition to the other errors already mentioned, you will need to append the "hop count" to the end our your route add command. If the gateway address is the local box, use 0. If the gateway address is a remote box (router), use 1.

Darrell

"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
harry d brown jr
Honored Contributor

Re: Add route - problem

Kenn,

mind cleaning this up??
This member has assigned points to 76 of 342 responses to his/her questions.

You can find ALL of your previous post here!
http://forums.itrc.hp.com/cm/TopSolutions/1,,CA457028!1!questions,00.html

live free or die
harry
Live Free or Die
Kenn Chen
Advisor

Re: Add route - problem

Thanks all. I would like to know how could i manual add in into netconf file (perm) instead of use route add command. i still cannot use route add command it point network not reachable. it is very weird. In my netconf file, i saw below :-

INTERFACE_NAME[0]=lan1
ip_address[0]=213.221.254.12
subnet_mask[0]=255.255.255.224
boardcast_address[0]=
interface_state[0]=
dhcp_enable[0]=

INTERFACE_NAME[0]=lan1:1
ip_address[0]=109.15.43.11
subnet_mask[0]=255.255.255.0
boardcast_address[0]=
interface_state[0]=
dhcp_enable[0]=

what is lan1:1 means ? it is visual ip configuration ? then if i want to add my route to this file...how will be the format. Thanks.
Cyber Zen
Kong Kian Chay
Regular Advisor

Re: Add route - problem

In /etc/rc.config.d/netconf, to configure routing entries, you should be looking at :

ROUTE_DESTINATION : the destination nework addr e.g 147.174.0.0
ROUTE_MASK : the destination subnet mask e.g 255.255.0.0
ROUTE_GATEWAY : the G/W IP-Addr
ROUTE_COUNT : the no. of Hops (0 or 1)

Note: ROUTE_DESTINATION can also refer to a Host IP-Addr. See the documentation in the netconf file itself.


Manoj Misra
Advisor

Re: Add route - problem

Hi,

Just modify this section of the netconf file

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

Add your destination in route destination and rest of the entries.
then restart the net deamon.
It should work.

The second entries in your netconf file is vertual second IP address configuration.

HTH
Manoj