OpenVZ Forum


Home » General » Support » multiple NICs on Different Networks with different default gateways
Re: multiple NICs on Different Networks with different default gateways [message #2881 is a reply to message #2880] Mon, 24 April 2006 20:06 Go to previous messageGo to previous message
Antarion is currently offline  Antarion
Messages: 17
Registered: December 2005
Location: Huerth
Junior Member
I've been working on a similar setup for quite a while now, heres what i've got - it already comes pretty close to what i want. Just remember, these are my first steps with iproute2 and routing in general Very Happy

My hostnode does have two NIC's, eth0 which does have a vlan covering the 62.75.xxx.yyy/24 range, eth1 which does have a vlan covering the 217.172.xxx.yyy/24 range.

Heres my CURRENT setup:

# flush everything
ip route flush cache

# set default routes for table 1 & 2
ip route add default via 62.75.xxx.1 dev eth0 tab 1
ip route add default via 217.172.xxx.1 dev eth1 tab 2


# add IP's within 62.75.xxx.0/24 to be used by VE's
ip rule add from 62.75.xxx.0/24 tab 1 priority 500

# Routing to VE's in the other "vlan"
# otherwise loop between hostnode
# and our default gateway (?!?!)
ip rule add from 62.75.xxx.0/24 iif venet0 lookup main

# add IPs within 217.172.xxx.0/24 to be used by VE's
ip rule add from 217.172.xxx.0/24 tab 2 priority 600

# Routing to VE's in the other "vlan"
# otherwise loop between hostnode
# and our default gateway (?!?!)
ip rule add from 217.172.xxx.0/24 iif venet0 lookup main

# ---- not sure if this is needed ----
ip route del default
ip route del default
ip route add default via 217.172.xxx.1 dev eth1

Maybe that helps, if you've got any suggestions let me know please! Smile

-Torsten
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: add several ips
Next Topic: *SOLVED* Moving default NIC
Goto Forum:
  


Current Time: Sat Aug 03 21:00:11 GMT 2024

Total time taken to generate the page: 0.02696 seconds