View previous topic :: View next topic |
Author |
Message |
yahont Tux's lil' helper
Joined: 20 Apr 2004 Posts: 119 Location: SPb
|
Posted: Tue Sep 08, 2009 7:42 am Post subject: [SOLVED] 2 NICs & 2 IPs: how to route? |
|
|
Hi all!
I have a server with 2 NICs connecting to the Net through two different providers. I'd like to have an access to the server through both NICs, but I haven't managed so far to set both of them up. I keep one of them down, cause I've no idea how to set up the routing scheme. All I want to have is the server sending its replies through the NIC where it got the request from, and - of course - via correspondent router. I don't (not yet, at least) even want to balance the traffic initiated by server itself.
Is there a simple way to set up such routing table with /etc/conf.d/net? Or should I mess up with some weird iptables' policies? Could you help me please?
Thank you in advance! _________________ This report, by its very length, defends itself against the risk of being read.
Winston Churchill
Last edited by yahont on Tue Sep 08, 2009 9:47 am; edited 1 time in total |
|
Back to top |
|
|
anello Guru
Joined: 17 Jul 2005 Posts: 557 Location: EU -> DE -> Stuttgart
|
Posted: Tue Sep 08, 2009 7:56 am Post subject: |
|
|
You can do this with iproute2.
Search for "iproute2 multiple uplink howto" or similar ... _________________ Antonino Catinello | http://catinello.eu |
|
Back to top |
|
|
yahont Tux's lil' helper
Joined: 20 Apr 2004 Posts: 119 Location: SPb
|
Posted: Tue Sep 08, 2009 9:45 am Post subject: |
|
|
Thank you for keywords, anello! I found quite useful page with them http://www.gentoo-wiki.info/TIP_Dual-Homed_Gentoo_Server.
I did everythin as described, and put
Code: | ip rule add from <secondary ip> table dns
|
into "postup()" function in /etc/conf.g/net.
Code: | postup() {
if [[ "${IFACE}" -eq "eth1" ]]; then
ip rule add from <IP for eth1> table eth1tab
fi
}
|
The second NIC is up now. And both IPs are responding from outside. _________________ This report, by its very length, defends itself against the risk of being read.
Winston Churchill |
|
Back to top |
|
|
|