Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 118056

Summary: vlan multiple default gateway not working as expected
Product: Gentoo Linux Reporter: Oliver Welter <gentoo>
Component: [OLD] baselayoutAssignee: Roy Marples (RETIRED) <uberlord>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: Normal    
Version: 2005.1   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Oliver Welter 2006-01-06 08:56:29 UTC
I have a NIC with two vlans on it

vlans_eth0="3 4";
vconfig_eth0=( "set_name_type VLAN_PLUS_VID_NO_PAD" );
config_vlan3=( "82.XX.XX.XX netmask 255.255.255.0" );
routes_vlan3=("default via 82.XX.XX.XX");

config_vlan4=( "212.XX.XX.XX/26" );
routes_vlan4=("default via 212.XX.XX.XX");

After setting up the netwok I have two vlans that are working "inside" the network itsself, but routing outside works only for the first network. 

The scripts setup the default gateway without using source routing, so there are two gateway's and even packets coming in on the vlan4 address are seem to be routed out through gateway on vlan3 so they dont get to its target...

Using this little script for source based routing on vlan4 solves the issue.
ip route add 212.18.24.192/26 dev vlan4 table 104
ip route add default via 212.18.24.193 dev vlan4 table 104
ip rule add from 212.18.24.192/26 table 104

So, I exepct that 
routes_vlan4=("default via 212.18.24.193");
adds the route "source based"...

Oliver
Comment 1 Roy Marples (RETIRED) gentoo-dev 2006-02-03 08:16:51 UTC
Marking as duplicate as that bug contains a patch to the iproute2 module which allows adding ip policy routing rules which you appear to need.

*** This bug has been marked as a duplicate of 107268 ***