Gentoo Archives: gentoo-user

From: Tom H <tomh0665@×××××.com>
To: Gentoo User <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Re: [SOLVED] What happened to my 2nd eth0?
Date: Tue, 24 Feb 2015 22:09:02
Message-Id: CAOdo=SyE1rnbEDyaHgza-7BB-mgNtf6F6SsjzsSq+Yv25m55Rg@mail.gmail.com
In Reply to: Re: [gentoo-user] Re: [SOLVED] What happened to my 2nd eth0? by Mick
1 On Tue, Feb 24, 2015 at 1:43 AM, Mick <michaelkintzios@×××××.com> wrote:
2 > On Monday 23 Feb 2015 08:39:42 Walter Dnes wrote:
3 >>
4 >> Looks like it's time to play around with the "ip" command and try to
5 >> duplicate my current setup. Does anyone have a multi-route setup
6 >> similar to mine configured with iproute2? The net.example file says
7 >>
8 >> # If you need more than one address, you can use something like this
9 >> # NOTE: ifconfig creates an aliased device for each extra IPv4 address
10 >> # (eth0:1, eth0:2, etc)
11 >> # iproute2 does not do this as there is no need to
12 >> # WARNING: You cannot mix multiple addresses on a line with other
13 >> parameters! #config_eth0="192.168.0.2/24 192.168.0.3/24 192.168.0.4/24"
14 >> # However, that only works with CIDR addresses, so you can't use
15 >> # netmask.
16 >>
17 >> What exactly do they mean by...
18 >> "iproute2 does not do this as there is no need to"
19 >
20 > There is no need to create virtual interfaces like eth0:1 to be able to have
21 > secondary IP addresses. The ip command adds them to the same eth0 interface.
22
23 Labels (iproute2 aliases) aren't required but can be useful:
24
25 # ip a sh dev wlan0
26 2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
27 group default qlen 1000
28 link/ether e8:2a:ea:0f:68:ec brd ff:ff:ff:ff:ff:ff
29 inet 192.168.1.240/24 brd 192.168.1.255 scope global wlan0
30 valid_lft forever preferred_lft forever
31
32 # ip a add 192.168.1.250/24 brd + label wlan0:0 dev wlan0
33
34 # ip a sh dev wlan0
35 2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
36 group default qlen 1000
37 link/ether e8:2a:ea:0f:68:ec brd ff:ff:ff:ff:ff:ff
38 inet 192.168.1.240/24 brd 192.168.1.255 scope global wlan0
39 valid_lft forever preferred_lft forever
40 inet 192.168.1.250/24 brd 192.168.1.255 scope global secondary wlan0:0
41 valid_lft forever preferred_lft forever
42
43 # ip a sh label wlan0:0
44 inet 192.168.1.250/24 brd 192.168.1.255 scope global secondary wlan0:0
45 valid_lft forever preferred_lft forever
46
47 # ip a fl label wlan0:0
48
49 # ip a sh dev wlan0
50 2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
51 group default qlen 1000
52 link/ether e8:2a:ea:0f:68:ec brd ff:ff:ff:ff:ff:ff
53 inet 192.168.1.240/24 brd 192.168.1.255 scope global wlan0
54 valid_lft forever preferred_lft forever

Replies

Subject Author
Re: [gentoo-user] Re: [SOLVED] What happened to my 2nd eth0? Walter Dnes <waltdnes@××××××××.org>