[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 4:03 PM, Steffen Dettmer
<steffen.dettmer@gmail.com> wrote:
> On Fri, Oct 18, 2013 at 3:24 PM, Tom H <tomh0665@gmail.com> wrote:


>>> I'm using Wheezy with ifup version 0.7.8, I think this is the
>>> latest officially released (aka "the best") one?
>>
>> Strange. I was under the impression that Debian 7's ifupdown is using
>> iproute but you had a vconfig error in an earlier email - and the
>> "trying to add" error below also looks like an ioctl error rather than
>> a netlink one.
>
> Ahh, that is a good point, yes, of course, there are old-style
> errors instead of this "NETLINK: file already exists"! I saw the
> message but completed missed that.
>
> I'm looking at "strace -e execve -f -o out ifup eth1.77", and one
> one box I see:
>
>   (no stat "vconfig")
>   ip link add link eth1 name eth1.77 type vlan id 77
>
> and on the other I see:
>
>   stat64("/sbin/vconfig", {st_mode=S_IFREG|0755, st_size=8032, ...}) = 0
>   vconfig set_name_type DEV_PLUS_VID_NO_PAD
>   vconfig add eth3 78
>
> I think I manually installed package "vlan" on only this second
> box at a previous test. This package is not on the first box
> (altough documentation seems to suggest it would be needed).
>
> If first strace would include stat(...vconfig...) I would assume
> ifup tries vconfig and fall-backs to ip (but I think it should be
> other way around), but may be there is a different way to detect
> usage of vconfig...

Well "debugged"! You're right - and I agree that it should be the
other way around.


>> Does anyone know whether adding an ip address with ip to an interface
>> configured with ifconfig isn't possible? Probably not.
>
> On Shell and without VLAN, I'm used to create first IP with
> "ifconfig ethX ip netmask ... up" and then use "ip addr add
> ...." (mostly because I always forget the ip link set up syntax :))
> and this works, so simply setting IPs normally is no issue
> (except that they are normally not visible in ifconfig of course).
>
>> So the post-up should be "post-up ifconfig eth0.9:0 192.168.1.199
>> netmask 255.255.255.0 up", although I can't remember ever coming
>> across such an interface (or know whether it's possible to do
>> something like this with net-tools!).
>
> The following commands procedure no error:
>
> ifconfig eth3.78:0 192.168.1.199 up
> ip addr add 192.168.1.200 dev eth3.78
> ip addr add 192.168.1.201 dev eth3.78:0   # funny :)
>
> resulting in
>
> 9: eth3.78@eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
> noqueue state UP
>     link/ether 08:00:27:46:0a:34 brd ff:ff:ff:ff:ff:ff
>     inet 10.0.5.15/24 brd 10.0.5.255 scope global eth3.78
>     inet 192.168.1.199/24 brd 192.168.1.255 scope global eth3.78:0
>     inet 192.168.1.199/32 scope global eth3.78
>     inet 192.168.1.200/32 scope global eth3.78
>
> So seems to be nicely compatible.

Thanks. And ip understands the ifconfig alias as a label. This rings a
bell; I should've remembered this and know that they were compatible.
Sorry.

So the "post-up ..." failure was due to something else...


>> Maybe you could try to do what you want using net-tools manually to
>> remove any ifupdown bug from the mix.
>
> Yes, this could be an option, but probably taking a day to
> implement and another for testing (I'm always optimistic, you see :)).

OK. :)


>>> Is the example above correct? Does it work for you? Could your
>>> machine be boot so quickly that it might not be visible without
>>> adding --noclear to /etc/inittab for tty1 getty?
>>
>> I tested once. I just took down the network so that only "lo" was
>> defined and then brought it up with what I'd posted.
>
> Do you have package vlan installed? Maybe I should retest after
> removing package "vlan"...

No, vlan isn't installed. So the vlan settings are being applied using ip.


Reply to: