This is on a F20 arm system. It SHOULD follow F20 rules...
first: cat /etc/udev/rules.d/70-persistent-net.rules
# Added by 'write_udev' for detected device 'eth0'. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:67:15:00:01:78", NAME="eth0"
First IP address is:
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0" BOOTPROTO=none ONBOOT="yes" TYPE="Ethernet" NAME="System eth0" MACADDR=02:67:15:00:01:63 MTU=1500 DNS1=208.83.67.188 GATEWAY="208.83.67.161" IPADDR="208.83.67.163" NETMASK="255.255.255.240" HOSTNAME="miredo.htt-consult.com" IPV6INIT="yes" DNS2=2607:f4b8:3:3:9254:5400:0:188
this works fine. But now for the second IP address I add:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0:0 DEVICE="eth0:0" BOOTPROTO=none ONBOOT="yes" TYPE="Ethernet" NAME="System eth0" MTU=1500 GATEWAY="208.83.67.161" IPADDR="208.83.67.164" NETMASK="255.255.255.240"
But no second IP address is shown:
]# ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 208.83.67.163 netmask 255.255.255.240 broadcast 208.83.67.175 inet6 fe80::67:15ff:fe00:163 prefixlen 64 scopeid 0x20<link> ether 02:67:15:00:01:63 txqueuelen 1000 (Ethernet) RX packets 21 bytes 2556 (2.4 KiB) RX errors 0 dropped 12 overruns 0 frame 0 TX packets 147 bytes 11726 (11.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 87 base 0x6000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 90 bytes 8076 (7.8 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 90 bytes 8076 (7.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
So what is missing? Do I need a 70-persistent-net.rules for eth0:0 ??
Or something else?
On Thu, 28 Aug 2014 16:16:55 -0400 Robert Moskowitz wrote:
So what is missing? Do I need a 70-persistent-net.rules for eth0:0 ??
These days, I'm pretty sure you are supposed to include IPADDR2=, NETMASK2=, etc. in the one ifcfg-eth0 file rather than creating a eth0:0 file (at least that worked for me on centos 6.5 this week when setting up IP aliases).
On 08/28/2014 04:24 PM, Tom Horsley wrote:
On Thu, 28 Aug 2014 16:16:55 -0400 Robert Moskowitz wrote:
So what is missing? Do I need a 70-persistent-net.rules for eth0:0 ??
These days, I'm pretty sure you are supposed to include IPADDR2=, NETMASK2=, etc. in the one ifcfg-eth0 file rather than creating a eth0:0 file (at least that worked for me on centos 6.5 this week when setting up IP aliases).
I added the IPADDR2 and NETMASK2 and it did not add the second address. Even after a reboot.
On 08/29/14 06:11, Robert Moskowitz wrote:
On 08/28/2014 04:24 PM, Tom Horsley wrote:
On Thu, 28 Aug 2014 16:16:55 -0400 Robert Moskowitz wrote:
So what is missing? Do I need a 70-persistent-net.rules for eth0:0 ??
These days, I'm pretty sure you are supposed to include IPADDR2=, NETMASK2=, etc. in the one ifcfg-eth0 file rather than creating a eth0:0 file (at least that worked for me on centos 6.5 this week when setting up IP aliases).
I added the IPADDR2 and NETMASK2 and it did not add the second address. Even after a reboot.
You may be getting confused by using "ifconfig".....
[egreshko@f20f network-scripts]$ cat ifcfg-p2p1 TYPE="Ethernet" BOOTPROTO=none DEFROUTE="yes" IPV4_FAILURE_FATAL=yes IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE="yes" IPV6_FAILURE_FATAL="no" NAME="p2p1" UUID="5ce325cb-5048-48d7-bdc0-457f278fe1f1" ONBOOT="yes" DNS1=192.168.1.18 DOMAIN=greshko.com HWADDR=08:00:27:B7:04:4A IPADDR0=192.168.1.227 PREFIX0=24 GATEWAY0=192.168.1.1 IPADDR1=192.168.1.19 PREFIX1=24 IPV6_PEERDNS=yes IPV6_PEERROUTES=yes
[egreshko@f20f network-scripts]$ ifconfig enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.227 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 2001:470:d:6bd:a00:27ff:feb7:44a prefixlen 64 scopeid 0x0<global> inet6 fe80::a00:27ff:feb7:44a prefixlen 64 scopeid 0x20<link> ether 08:00:27:b7:04:4a txqueuelen 1000 (Ethernet) RX packets 478 bytes 57719 (56.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 383 bytes 54641 (53.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
*BUT*
[egreshko@f20f network-scripts]$ ip addr 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 08:00:27:b7:04:4a brd ff:ff:ff:ff:ff:ff inet 192.168.1.227/24 brd 192.168.1.255 scope global enp0s3 valid_lft forever preferred_lft forever inet 192.168.1.19/24 brd 192.168.1.255 scope global secondary enp0s3 valid_lft forever preferred_lft forever inet6 2001:470:d:6bd:a00:27ff:feb7:44a/64 scope global noprefixroute dynamic valid_lft 7200sec preferred_lft 600sec inet6 fe80::a00:27ff:feb7:44a/64 scope link valid_lft forever preferred_lft forever
And from a second system....
[egreshko@meimei ~]$ ping 192.168.1.19 PING 192.168.1.19 (192.168.1.19) 56(84) bytes of data. 64 bytes from 192.168.1.19: icmp_seq=1 ttl=64 time=0.337 ms 64 bytes from 192.168.1.19: icmp_seq=2 ttl=64 time=0.290 ms 64 bytes from 192.168.1.19: icmp_seq=3 ttl=64 time=0.269 ms
On 08/29/14 07:20, Ed Greshko wrote:
And from a second system....
[egreshko@meimei ~]$ ping 192.168.1.19 PING 192.168.1.19 (192.168.1.19) 56(84) bytes of data. 64 bytes from 192.168.1.19: icmp_seq=1 ttl=64 time=0.337 ms 64 bytes from 192.168.1.19: icmp_seq=2 ttl=64 time=0.290 ms 64 bytes from 192.168.1.19: icmp_seq=3 ttl=64 time=0.269 ms
For completeness....
[egreshko@meimei ~]$ ssh 192.168.1.19 Last login: Fri Aug 29 07:15:07 2014 from meimei.greshko.com [egreshko@f20f ~]$ exit logout Connection to 192.168.1.19 closed.
[egreshko@meimei ~]$ ssh 192.168.1.227 Last login: Fri Aug 29 07:31:22 2014 from meimei.greshko.com
It is all ifconfigs fault :)
I just assumed that in f20 it was still good enough until F21.....
# cat /etc/udev/rules.d/70-persistent-net.rules
# Added by 'write_udev' for detected device 'eth0'. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:67:15:00:01:78", NAME="eth0"
# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE="eth0" BOOTPROTO=none ONBOOT="yes" TYPE="Ethernet" NAME="System eth0" MACADDR=02:67:15:00:01:63 MTU=1500 DNS1=208.83.67.148 GATEWAY="208.83.67.161" IPADDR="208.83.67.163" IPADDR2="208.83.67.164" NETMASK="255.255.255.240" NETMASK2="255.255.255.240" HOSTNAME="miredo.htt-consult.com" IPV6INIT="yes" DNS2=2607:f4b8:3:0:9254:5400:0:148
# ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 02:67:15:00:01:63 brd ff:ff:ff:ff:ff:ff inet 208.83.67.163/28 brd 208.83.67.175 scope global eth0 inet 208.83.67.164/28 brd 208.83.67.175 scope global secondary eth0 inet6 fe80::67:15ff:fe00:163/64 scope link valid_lft forever preferred_lft forever
On 08/28/2014 07:37 PM, Tom Horsley wrote:
On Fri, 29 Aug 2014 07:20:18 +0800 Ed Greshko wrote:
You may be getting confused by using "ifconfig".....
Yea, I forgot that bit, my aliases didn't show up in ifconfig, but I could ping them from another computer on the same network.
On 08/28/2014 07:20 PM, Ed Greshko wrote:
On 08/29/14 06:11, Robert Moskowitz wrote:
On 08/28/2014 04:24 PM, Tom Horsley wrote:
On Thu, 28 Aug 2014 16:16:55 -0400 Robert Moskowitz wrote:
So what is missing? Do I need a 70-persistent-net.rules for eth0:0 ??
These days, I'm pretty sure you are supposed to include IPADDR2=, NETMASK2=, etc. in the one ifcfg-eth0 file rather than creating a eth0:0 file (at least that worked for me on centos 6.5 this week when setting up IP aliases).
I added the IPADDR2 and NETMASK2 and it did not add the second address. Even after a reboot.
You may be getting confused by using "ifconfig".....
[egreshko@f20f network-scripts]$ cat ifcfg-p2p1 TYPE="Ethernet" BOOTPROTO=none DEFROUTE="yes" IPV4_FAILURE_FATAL=yes IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE="yes" IPV6_FAILURE_FATAL="no" NAME="p2p1" UUID="5ce325cb-5048-48d7-bdc0-457f278fe1f1" ONBOOT="yes" DNS1=192.168.1.18 DOMAIN=greshko.com HWADDR=08:00:27:B7:04:4A IPADDR0=192.168.1.227 PREFIX0=24 GATEWAY0=192.168.1.1 IPADDR1=192.168.1.19 PREFIX1=24 IPV6_PEERDNS=yes IPV6_PEERROUTES=yes
[egreshko@f20f network-scripts]$ ifconfig enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.227 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 2001:470:d:6bd:a00:27ff:feb7:44a prefixlen 64 scopeid 0x0<global> inet6 fe80::a00:27ff:feb7:44a prefixlen 64 scopeid 0x20<link> ether 08:00:27:b7:04:4a txqueuelen 1000 (Ethernet) RX packets 478 bytes 57719 (56.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 383 bytes 54641 (53.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
*BUT*
[egreshko@f20f network-scripts]$ ip addr 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 08:00:27:b7:04:4a brd ff:ff:ff:ff:ff:ff inet 192.168.1.227/24 brd 192.168.1.255 scope global enp0s3 valid_lft forever preferred_lft forever inet 192.168.1.19/24 brd 192.168.1.255 scope global secondary enp0s3 valid_lft forever preferred_lft forever inet6 2001:470:d:6bd:a00:27ff:feb7:44a/64 scope global noprefixroute dynamic valid_lft 7200sec preferred_lft 600sec inet6 fe80::a00:27ff:feb7:44a/64 scope link valid_lft forever preferred_lft forever
And from a second system....
[egreshko@meimei ~]$ ping 192.168.1.19 PING 192.168.1.19 (192.168.1.19) 56(84) bytes of data. 64 bytes from 192.168.1.19: icmp_seq=1 ttl=64 time=0.337 ms 64 bytes from 192.168.1.19: icmp_seq=2 ttl=64 time=0.290 ms 64 bytes from 192.168.1.19: icmp_seq=3 ttl=64 time=0.269 ms
# ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000 link/ether 02:56:02:01:f3:b9 brd ff:ff:ff:ff:ff:ff inet 208.83.67.163/28 brd 208.83.67.175 scope global eth0 inet 208.83.67.164/28 brd 208.83.67.175 scope global secondary eth0 inet6 fe80::56:2ff:fe01:f3b9/64 scope link valid_lft forever preferred_lft forever
you are right. ifconfig USE to be able to do this, but now it is just a shell? over ip and so...
So now to undo a lot of changes and see if I can get back to everything working.
On 29 Aug 2014 01:32, "Robert Moskowitz" rgm@htt-consult.com wrote:
you are right. ifconfig USE to be able to do this, but now it is just a
shell? over ip and so...
Your memory isn't quite accurate... ifconfig has never handled multiple IP addresses on an interface with aliases being used to create separate virtual interfaces instead.
It is also not a shell over ip but rather a completely different package with a completely different development history...
This is just yet another example of why net-tools has been deprecated a long time and that people really need to break their muscle memory and use iproute2 ...
Is net-tools still in the base fedora install? Probably long since time to pull it if so... I know el7 doesn't include it in base or core package groups anymore at least..
On 08/29/2014 01:48 AM, James Hogarth wrote:
On 29 Aug 2014 01:32, "Robert Moskowitz" <rgm@htt-consult.com mailto:rgm@htt-consult.com> wrote:
you are right. ifconfig USE to be able to do this, but now it is
just a shell? over ip and so...
Your memory isn't quite accurate... ifconfig has never handled multiple IP addresses on an interface with aliases being used to create separate virtual interfaces instead.
Well recently I was going by:
http://www.tecmint.com/create-multiple-ip-addresses-to-one-single-network-in...
Which show ifconfig listing all the ethn:m interfaces. Also I use to do a lot of vlaning when I ran radvd on linux before my firewall supported it. Now maybe that was back in Centos 4 days.
It is also not a shell over ip but rather a completely different package with a completely different development history...
This is just yet another example of why net-tools has been deprecated a long time and that people really need to break their muscle memory and use iproute2 ...
Working on it. Really.
Is net-tools still in the base fedora install? Probably long since time to pull it if so... I know el7 doesn't include it in base or core package groups anymore at least..
On Thu, Aug 28, 2014 at 8:32 PM, Robert Moskowitz rgm@htt-consult.com wrote:
# ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000 link/ether 02:56:02:01:f3:b9 brd ff:ff:ff:ff:ff:ff inet 208.83.67.163/28 brd 208.83.67.175 scope global eth0 inet 208.83.67.164/28 brd 208.83.67.175 scope global secondary eth0 inet6 fe80::56:2ff:fe01:f3b9/64 scope link valid_lft forever preferred_lft forever
you are right. ifconfig USE to be able to do this, but now it is just a shell? over ip and so...
So now to undo a lot of changes and see if I can get back to everything working.
ip (and ss, bridge, tc, and other iproute binaries) and ifconfig (and route, netstat, brctl, ... and other net-tools and bridge-utils binaries) use different kernel interfaces.
AIUI, the ifconfig interface is deprecated but kept for backward compatibility.
On Thu, Aug 28, 2014 at 6:11 PM, Robert Moskowitz rgm@htt-consult.com wrote:
On 08/28/2014 04:24 PM, Tom Horsley wrote:
These days, I'm pretty sure you are supposed to include IPADDR2=, NETMASK2=, etc. in the one ifcfg-eth0 file rather than creating a eth0:0 file (at least that worked for me on centos 6.5 this week when setting up IP aliases).
I added the IPADDR2 and NETMASK2 and it did not add the second address. Even after a reboot.
If you use IPADDR2, you have to display ip addresses with "ip a" because "ifconfig" won't see the second address.
On 08/28/14 22:16, Robert Moskowitz wrote:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0:0 DEVICE="eth0:0" BOOTPROTO=none ONBOOT="yes" TYPE="Ethernet" NAME="System eth0" MTU=1500 GATEWAY="208.83.67.161" IPADDR="208.83.67.164" NETMASK="255.255.255.240"
I think you need to add ONPARENT=yes to make it start when its parent does.
That is at least the major difference I see comparing to my setup.
Lars
On 08/28/2014 04:35 PM, Lars E. Pettersson wrote:
On 08/28/14 22:16, Robert Moskowitz wrote:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0:0 DEVICE="eth0:0" BOOTPROTO=none ONBOOT="yes" TYPE="Ethernet" NAME="System eth0" MTU=1500 GATEWAY="208.83.67.161" IPADDR="208.83.67.164" NETMASK="255.255.255.240"
I think you need to add ONPARENT=yes to make it start when its parent does.
That is at least the major difference I see comparing to my setup.
Add this to ifcfg-eth0:0 and no change.
:(
Got to keep on trying.
29 aug 2014 kl. 00:12 skrev Robert Moskowitz rgm@htt-consult.com Add this to ifcfg-eth0:0 and no change.
:(
Ok. Another difference I see is that my interface is named :1, i.e. in my case wan:1 Not sure if that makes any difference though, was years since I set this up :)
Lars
On 08/28/2014 06:23 PM, Lars E. Pettersson wrote:
29 aug 2014 kl. 00:12 skrev Robert Moskowitz rgm@htt-consult.com Add this to ifcfg-eth0:0 and no change.
:(
Ok. Another difference I see is that my interface is named :1, i.e. in my case wan:1 Not sure if that makes any difference though, was years since I set this up :)
I took out the macaddr changes I was making, trying to go back to as much 'base' stuff as I could, and it still is not giving me a 2nd ip addr.
:(
On Thu, Aug 28, 2014 at 10:35 PM, Lars E. Pettersson lars@homer.se wrote:
On 08/28/14 22:16, Robert Moskowitz wrote:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0:0 [snipped] ONBOOT="yes"
I think you need to add ONPARENT=yes to make it start when its parent does.
ONPARENT=yes is indeed the parameter instead of ONBOOT for aliases. It would not matter here, as "yes" is the default value. As far as I am aware the suggestion from Tom Horsley with things like IPADDR2, NETMASK2 in the file of the parent is cuurently the preferred method. (Not my preferred method, but then perhaps I am just stuck with old stuff that I know.) :)
On 08/29/2014 01:12 AM, Andre Speelmans wrote:
On Thu, Aug 28, 2014 at 10:35 PM, Lars E. Pettersson lars@homer.se wrote:
On 08/28/14 22:16, Robert Moskowitz wrote:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0:0 [snipped] ONBOOT="yes"
I think you need to add ONPARENT=yes to make it start when its parent does.
ONPARENT=yes is indeed the parameter instead of ONBOOT for aliases. It would not matter here, as "yes" is the default value. As far as I am aware the suggestion from Tom Horsley with things like IPADDR2, NETMASK2 in the file of the parent is cuurently the preferred method. (Not my preferred method, but then perhaps I am just stuck with old stuff that I know.) :)
I have been digging into real old configs from systems long gone (like back in '08). I used the ifcfg-ethn.m for vlaning by including VLAN=yes, and then 'm' was the vlan number. And the time back then that I ran miredo I used the IPADDR2= method (miredo needs 2 IPv4 addresses).