Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Trying to set up a server in Debian that has one network card but two separate gateways on it (i.e. in two separate subnets). I've been trying and failing miserably in this:
I'd like to have one network on eth0
10.45.36.15 Address
10.45.36.4 Gateway
255.255.255.0 Netmask
and the other on eth0:2
10.197.82.124 Address
10.197.82.117 Gateway
255.255.255.240 Netmask
It's probably the easiest thing in the world, but what the hell is the route command I need to get this working? I've tried
Code:
route add -net 10.197.82.124/28 gw 10.197.82.117 dev eth0:2
to be hit with
Code:
SIOCADDRT: No such process
Oh yes, and it has to be a permanent route, so if I reboot or the power fails, it comes back.
Sorry, my bad - I'm trying to get the network address to be .124 as per the original question, hence the strange /28 on there. I believe(d) that put me in the right range as per your subnet calculation.
You are not lost yet, when configuring things in /etc/network/interfaces you specify default gateways.
You need routing with conditions, I have no experience with it but with iproute you can specify things like what comes in on one interface goes out on that interface.
PS : is it only me or is LQ about to 'explode' ? (lots of timeouts when coming on this board)
Oh, that would be an interesting exercise - mind you I tried doing this so that I didn't have to figure out how to configure routing with iproute. ;-) Our previous server that was working on doing this (as in "Leave it alone, it's working!" never had its config saved and on reboot all our routing connections disappeared into the ether never to be seen again.
Can someone with exposure to iproute point me in the general direction of what I'm supposed to be looking at/doing? I'm normally reasonably smart at figuring these things out myself...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.