[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Configuring multiple IP addresses on VLAN interface using ifupdown



On Fri, Oct 18, 2013 at 9:49 AM, Steffen Dettmer
<steffen.dettmer@gmail.com> wrote:
> On Fri, Oct 18, 2013 at 9:53 AM, Tom H <tomh0665@gmail.com> wrote:
>>>
>>>   auto eth0
>>>   iface eth0 inet static
>>>           address 10.0.5.16
>>>           netmask 255.255.255.0
>>>   iface eth0.77 inet manual
>>>   auto br0.77
>>>   iface br0.77 inet manual
>>>           bridge_ports eth0.77
>>>           bridge_fd 0
>>>           bridge_maxwait 0
>>
>> You're bridging in strange/incorrect way. :(
>>
>> It's br0.77 that should have an ip address assigned and the physical
>> devices should have "inet manual" only.
>
> The "physical" interface eth0.77 has no IP in the example above,
> but is it possible to bridge VLAN devices?
> I had assumed someone has to bridge e.g. eth0 and use the VLAN
> tags only on top of br0.

You can assign a VLAN to a bridge (or whatever the proper expression is!).

I don't know how it's done with "/etc/network/interfaces" but I do
know how to do so with RHEL ifcfg files so I can extrapolate
_something_ theoretical.

But the use-case that I have for that is different and I'm not too
sure how to transpose to yours, if it's at all possible.

The use-case is for connecting VMs on one host to different VLANs
(note: _different_ VLANs). So VM0's tap0 is added to br0.I, VM1's tap1
is added to br0.J, ethX (or bondX if you have bonds) is assigned to
VLANs x and y and added to br0.I and br0.J respectively, and these
bridges are assigned ip addresses.

So trying to mimick ifcfg files from memory (and keeping in mind that
in ifcfg files I'd have the equivalent of "allow-auto eth0",
"allow-auto eth0.I", "allow-auto eth0.J" too but it doesn't seem to be
needed in "/etc/network/interfaces"):

iface eth0 inet manual

iface eth0.I inet manual

iface eth0.J inet manual

allow-auto br0.I
iface br0.I inet static
bridge_ports eth0.I tap0
address ...
netmask ...
gateway ...
<other_bridge_stuff>

allow-auto br0.J
iface br0.J inet static
bridge_ports eth0.J tap1
address ...
netmask ...
gateway ...
<other_bridge_stuff>

So, in your case, assuming that you want a bridge:

iface eth0 inet manual

iface eth0.I inet manual

allow-auto br0.I
iface br0.I inet static
bridge_ports eth0.I
address ...
netmask ...
gateway ...
<other_bridge_stuff>
post-up ip address add ... dev br0.I


Reply to: