From: Brian Austin - Standard Universal <brian@standarduniversal.com.au>
To: Lloyd Standish <lloyd@crnatural.net>
Cc: "netfilter@vger.kernel.org" <netfilter@vger.kernel.org>
Subject: Re: can't set default route for virtual interface
Date: Wed, 28 Dec 2011 11:40:05 +1100 [thread overview]
Message-ID: <4EFA6565.7050808@standarduniversal.com.au> (raw)
In-Reply-To: <op.v654qjz3x1lyi3@debiandesk2.net>
table T1 needs this first?
ip route add 192.168.2.0/24 dev eth0.3 src 192.168.2.10 table T1
On 28/12/2011 10:32 AM, Lloyd Standish wrote:
> 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
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-12-28 0:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2011-12-28 0:42 ` Brian Austin - Standard Universal
2011-12-28 1:56 ` Lloyd Standish
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EFA6565.7050808@standarduniversal.com.au \
--to=brian@standarduniversal.com.au \
--cc=lloyd@crnatural.net \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox