1821585 Members
3405 Online
109633 Solutions
New Discussion юеВ

Default Route on HP UX

 
Ralf_Reinartz
New Member

Default Route on HP UX

Hello,

could anyone help me to understand?

I try to set an default route on some machines. Because it is easier t generate ain a script I did it in the Way:

route add net 0.0.0.0 mask 0.0.0.0 xx.xx.xx.xx 1

netstat -rn shows correct :

default xx.xx.xx.xx UG 0 lan0 0

But the route does not match.

When I delete the Route and set it with

route add default xx.xx.xx.xx 1

the netstat -rn shows the same and the route matches.

Why? Whre are the differences?

One more Question:

The machine has som more addresses in the same subnet on this physical Interface (lan0, lan0:1 lan0:2)

How can I decide witch Adress is used vor outgoing pakets? On Linux Systems I can add the Interface to the route command. Is there anythin similar in hp-ux?

kind regards

ralf


3 REPLIES 3
Tim Nelson
Honored Contributor

Re: Default Route on HP UX

route add default 192.168.x.x 1

edit /etc/rc.config.d/netconf to make permanent.

Sandman!
Honored Contributor

Re: Default Route on HP UX

Reason why the two routes are same is because their netmask is the same:

# route add net 0.0.0.0 mask 0.0.0.0 xx.xx.xx.xx 1

...above route has a netmask of 0.0.0.0 as does the one below:

# route add default xx.xx.xx.xx 1

...which can be verified by looking at the routing table along with the netmask value of the destinations i.e.

# netstat -rnv
Armin Kunaschik
Esteemed Contributor

Re: Default Route on HP UX

I suspect, that 0.0.0.0 is no equvalent to default. See "man netstat" and "man 7 routing".
You can expect a difference between host, net and default when you read in routing(7):

Destination The destination Internet address: host name,
network name, or default.

The other question is easier to answer:
Default source is always the physical interface and never an alias. Maybe you can work around this with ipf, I can't imaging a way with "route".

My 2 cents,
Armin

PS: Assign points, if you find answers useful!
And now for something completely different...