All of lore.kernel.org
 help / color / mirror / Atom feed
* can't set default route for virtual interface
@ 2011-12-27 23:32 Lloyd Standish
  2011-12-27 23:43 ` Andrew Beverley
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Lloyd Standish @ 2011-12-27 23:32 UTC (permalink / raw)
  To: netfilter@vger.kernel.org

Hi All,

I'm setting up multiple virtual interfaces to allow load-balancing over several uplinks using a single NIC, on Debian Squeeze.  Packets will be marked by iptables, and sent to the proper routing tables via "ip rule add fwmark <n>".

I'm having trouble setting routes for the VLANs.

root@debiandesk2:/etc/network# ifconfig

192.168.100.255  Mask:255.255.255.0
            inet6 addr: fe80::22cf:30ff:fed8:6bea/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:49654 errors:0 dropped:0 overruns:0 frame:0
            TX packets:54712 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:35989170 (34.3 MiB)  TX bytes:8795113 (8.3 MiB)
            Interrupt:27 Base address:0xc000

eth1      Link encap:Ethernet  HWaddr 00:08:54:dc:1b:79
            inet addr:192.168.10.1  Bcast:192.168.10.255  Mask:255.255.255.0
            inet6 addr: fe80::208:54ff:fedc:1b79/64 Scope:Link
            UP BROADCAST MULTICAST  MTU:1500  Metric:1
            RX packets:6077 errors:0 dropped:0 overruns:0 frame:0
            TX packets:9451 errors:0 dropped:0 overruns:0 carrier:73
            collisions:0 txqueuelen:1000
            RX bytes:821439 (802.1 KiB)  TX bytes:9756873 (9.3 MiB)
            Interrupt:19 Base address:0xdc00

eth0.2    Link encap:Ethernet  HWaddr 20:cf:30:d8:6b:ea
            inet addr:192.168.200.10  Bcast:192.168.200.255  Mask:255.255.255.0
            inet6 addr: fe80::22cf:30ff:fed8:6bea/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:17776 errors:0 dropped:0 overruns:0 frame:0
            TX packets:15037 errors:0 dropped:1 overruns:0 carrier:0
            collisions:0 txqueuelen:0
            RX bytes:16258598 (15.5 MiB)  TX bytes:2075870 (1.9 MiB)

eth0.3    Link encap:Ethernet  HWaddr 20:cf:30:d8:6b:ea
            inet addr:192.168.2.10  Bcast:192.168.2.255  Mask:255.255.255.0
            inet6 addr: fe80::22cf:30ff:fed8:6bea/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:1083 errors:0 dropped:0 overruns:0 frame:0
            TX packets:1320 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0
            RX bytes:113499 (110.8 KiB)  TX bytes:273602 (267.1 KiB)

My firewall/load-balancing script is able to set the routes for the first virtual interface (eth0.2) OK:

+ ip route flush table T0
+ ip route add 192.168.200.0/24 dev eth0.2 src 192.168.200.10 table T0
+ ip rule add from 192.168.200.10 table T0
+ ip rule add iif lo to 201.200.105.6 table T0
+ ip route add 192.168.10.0/24 dev eth1 table T0
+ ip route add 127.0.0.0/8 dev lo table T0
+ ip rule del from all fwmark 0
+ ip rule add fwmark 0 table T0
+ ip route add 192.168.200.0/24 dev eth0.2 src 192.168.200.10
+ ip route add default via 192.168.200.1 table T0

However, it fails as follows when adding the default route for the second virtual interface (eth0.3):

+ ip route flush table T1
+ ip route add 192.168.2.0/24 dev eth0.3 src 192.168.2.10 table T1
+ ip rule add from 192.168.2.10 table T1
+ ip rule add iif lo to 8.8.4.4 table T1
+ ip route add 192.168.10.0/24 dev eth1 table T1
+ ip route add 127.0.0.0/8 dev lo table T1
+ ip rule del from all fwmark 1
+ ip rule add fwmark 1 table T1
+ ip route add 192.168.2.0/24 dev eth0.3 src 192.168.2.10
+ ip route add default via 192.168.2.1 table T1
RTNETLINK answers: No such process

Similarly, I was unable to use "ip" to set a "nexthop via" default route for virtual interfaces.

I'd greatly appreciate any help.

Regards,
Lloyd

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-12-29 15:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-27 23:32 can't set default route for virtual interface Lloyd Standish
2011-12-27 23:43 ` Andrew Beverley
2011-12-28  5:36   ` Lloyd Standish
2011-12-28 10:21     ` Andrew Beverley
2011-12-29 11:27       ` Amos Jeffries
2011-12-29 15:39         ` Andrew Beverley
2011-12-29 15:53       ` Jan Engelhardt
2011-12-28  0:40 ` Brian Austin - Standard Universal
2011-12-28  0:42 ` Brian Austin - Standard Universal
2011-12-28  1:56   ` Lloyd Standish

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.