1834931 Members
2417 Online
110071 Solutions
New Discussion

Re: routing to a device.

 
SOLVED
Go to solution
Rudi Swennen_1
Occasional Contributor

routing to a device.

Hey,

When using a computer with Linux, I can plug in 1 NIC and configure it with "ifconfig eth0 10.0.14.122 netmask 255.255.255.0 broadcast 10.0.14.255". So the computer is working on the network 10.0.14.0. When now a visitor plugs in his laptop with IP-adress 125.23.56.7 and mask 255.255.255.0, I just have to adjust a route on my Linux machine with "route add -net 125.23.56.0 netmask 255.255.255.0 dev eth0". So when the Linux machine has to look foor the IP-adress I told him to look for it on the interface eth0.

Is there is something equivalent on hp-ux 10.20, because the man pages don't speak about a device just about a gateway, but that isn't what I need.

So the question is: can I say to unix to route to a device (lan0) not knowing what else ip-adresses or gateways are configured.
3 REPLIES 3
monasingh_1
Trusted Contributor

Re: routing to a device.

I think you will need to know the router port address at your end (10.0.14.x) and will need to add that while doing route add. In HP, I have not seen doing route add other than using remote gateway address.

Adam J Markiewicz
Trusted Contributor

Re: routing to a device.

I have to admit, I'm affraid I didn't get exactly what do you mean.

However as I've read your example I see that you want to add another network for routing for specified NIC.

In your example isn't this what are you lookig for?:

route add net 125.23.56.0 netmask 255.255.255.0 10.0.14.122 0

The last two arguments say:
first: route it through the interface of this IP; second: this is local network rather that gateway.


Good luck

Adam
I do everything perfectly, except from my mistakes
Vincent Fleming
Honored Contributor
Solution

Re: routing to a device.

When I need to do stuff like this, I usually just alias the interface;

(on HP-UX) ifconfig eth0 alias 125.23.56.1 netmask 255.255.255.0

...and it works.

But I also run dhcpd, so foreign laptops and such get assigned addresses in my range.

-Vince
No matter where you go, there you are.