1752785 Members
6156 Online
108789 Solutions
New Discussion юеВ

Re: IP routing

 
SOLVED
Go to solution
Paul Dray
Occasional Contributor

IP routing

To All.

I added a route to HP-UX 10.20 as follows:
" route add net 10.254.253.160 10.1.19.254 netmask 255.255.255.240 5 ".

when I look at routing table by " netstat -rn " I see the following line:
" 10.254.253.0 10.1.19.154 U 6 2258 lan2 1500 "

This has not taken to forth value " 160 ". This mean to me that all 255 addresses will be routed not just 160-175.

Q1/ Is this the way it works or have I missed something ?

Q2/ If there is a way to route just the subnet, HOW and WHY ?

Thanks for any interest.

Paul.
2 REPLIES 2
John Palmer
Honored Contributor
Solution

Re: IP routing

I believe that your command should have been 'route add net 10.254.253.160 netmask 255.255.255.240 10.1.19.254 5'
Mike McKinlay
Honored Contributor

Re: IP routing

In looking at your statement:

route add net 10.254.253.160 10.1.19.254 netmask 255.255.255.240 5

I went back and referred to the man page on route, which shows the syntax:

/usr/sbin/route [-f] [-n] [-p pmtu] add [net|host] destination [netmask mask] gateway [count]

I think you have the gateway in the wrong spot in your command, so it should look like:

route add net 10.254.253.160 netmask 255.255.255.240 10.1.19.254 5

The only question I have is the hop count of 5.
"Hope springs eternal."