Two gateways?
Hi
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:
Code:
SIOCADDRT: No such process TIA wonderful people |
10.197.82.124/28 is not a network but a IP address.
your network address should be : 10.197.82.112 and broadcast : 10.197.82.127 useable IP addresses : 10.197.82.113 to 10.197.82.126 PS : hope I got that right long time I did subnet calculation ^^ |
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.
|
But still your route wouldn't make sense because it's a directly connected network and it should be in the routing table by default.
What are you really trying to accomplish? |
I'm trying to get the server to respond to a particular website address on this IP (has to be this IP, no others will do).
As a result the server has to send back packets via a gateway that is in the same subnet, hence me asking for a second gateway for the network card. So theoretically it looks like this: Code:
iface eth0 inet static Regards |
Your configurations is asking for 2 default gateways that can't be done.
You cannot have 2 default gateways! |
Well, tbh, I didn't think it was a flier but someone assured me it could be done. Oh well, you live and learn. Thank you Dani1973!
|
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... And again, Many thanks Dani1973... |
check the cli history on the old server maybe you will be lucky and it's in there -> /root/.bash_history
|
Unfortunately in the process of trying to get it back, we updated the system and borked it a little and now it doesn't even boot....
|
That's where a live CD can be handy ;)
|
All times are GMT -5. The time now is 01:55 PM. |