I am trying to override the mac addr. Now this is on an armv7 actually running the F19 kernel and Redsleeve 6, but it SHOULD be standard Centos6 ifcfg-eth0 content. Of course RSEL does not start with a ifcfg-eth0 file, letting network services do all the work, so I am starting from scratch, using the file from one of my C6 boxes with static addressing. My file has in it:
DEVICE="eth0" BOOTPROTO=none NM_CONTROLLED="no" ONBOOT="yes" TYPE="Ethernet" NAME="System eth0" DNS1=208.83.67.188 GATEWAY="208.83.67.177" IPADDR="208.83.67.179" HOSTNAME="rigel2.htt-consult.com" IPV6INIT="yes" MACADDR=02:67:15:00:01:79 MTU=1500
And when I restart network, it can't find eth0:
# service network restart Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization. [FAILED]
but:
# ifconfig eth1 Link encap:Ethernet HWaddr 02:67:15:00:01:79 inet addr:208.83.67.179 Bcast:208.83.67.255 Mask:255.255.255.0 inet6 addr: 2607:f4b8:3:3:67:15ff:fe00:179/64 Scope:Global inet6 addr: fe80::67:15ff:fe00:179/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:254 errors:0 dropped:17 overruns:0 frame:0 TX packets:70 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:26575 (25.9 KiB) TX bytes:6104 (5.9 KiB) Interrupt:87 Base address:0x6000
The assigned MAC addr for eth0 is: 02:c3:04:01:77:c3
The tutorials that I have found on ifcfg-ethN say not to use both hwaddr and macaddr in the same cfg file, but it almost seems that is what is needed?
thanks
On 8/21/2014 7:09 AM, Robert Moskowitz wrote:
I am trying to override the mac addr.
pretty sure you need to use NIC model specific utilities to do this, ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, not for reprogramming it.
On 2014-08-21, John R Pierce pierce@hogranch.com wrote:
On 8/21/2014 7:09 AM, Robert Moskowitz wrote:
I am trying to override the mac addr.
pretty sure you need to use NIC model specific utilities to do this, ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, not for reprogramming it.
ifconfig claims to support it:
hw class address Set the hardware address of this interface, if the device driver supports this operation. The keyword must be followed by the name of the hardware class and the printable ASCII equivalent of the hardware address. Hardware classes currently supported include ether (Ethernet), ax25 (AMPR AX.25), ARCnet and netrom (AMPR NET/ROM).
The important item is of course "if the device driver supports this operation". If not then a tool downloaded from the NIC manufacturer might be the only way.
Unfortunately I do not know whether ifcfg-eth* supports this ifconfig syntax.
--keith
Keith Keller wrote:
On 2014-08-21, John R Pierce pierce@hogranch.com wrote:
On 8/21/2014 7:09 AM, Robert Moskowitz wrote:
I am trying to override the mac addr.
pretty sure you need to use NIC model specific utilities to do this, ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, not for reprogramming it.
ifconfig claims to support it:
hw class address
<snip> Also, don't forget /etc/udev/rules.d/70-persistant-net.rules
mark
On 08/21/2014 10:32 AM, m.roth@5-cent.us wrote:
Keith Keller wrote:
On 2014-08-21, John R Pierce pierce@hogranch.com wrote:
On 8/21/2014 7:09 AM, Robert Moskowitz wrote:
I am trying to override the mac addr.
pretty sure you need to use NIC model specific utilities to do this, ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, not for reprogramming it.
ifconfig claims to support it:
hw class address
<snip> Also, don't forget /etc/udev/rules.d/70-persistant-net.rules
I can't forget what I don't know. please point me to description of these rules?
On 21/08/14 10:43 AM, Robert Moskowitz wrote:
On 08/21/2014 10:32 AM, m.roth@5-cent.us wrote:
Keith Keller wrote:
On 2014-08-21, John R Pierce pierce@hogranch.com wrote:
On 8/21/2014 7:09 AM, Robert Moskowitz wrote:
I am trying to override the mac addr.
pretty sure you need to use NIC model specific utilities to do this, ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, not for reprogramming it.
ifconfig claims to support it:
hw class address
<snip> Also, don't forget /etc/udev/rules.d/70-persistant-net.rules
I can't forget what I don't know. please point me to description of these rules?
It's used to assign names to physical devices via udev. How it works depends a bit on your version.
It's discussed as part of these tutorials:
CentOS 6: https://alteeve.ca/w/Changing_the_ethX_to_Ethernet_Device_Mapping_in_EL6_and...
CentOS 7: https://alteeve.ca/w/Changing_Ethernet_Device_Names_in_EL7_and_Fedora_15%2B
On 08/21/2014 10:49 AM, Digimer wrote:
On 21/08/14 10:43 AM, Robert Moskowitz wrote:
On 08/21/2014 10:32 AM, m.roth@5-cent.us wrote:
Keith Keller wrote:
On 2014-08-21, John R Pierce pierce@hogranch.com wrote:
On 8/21/2014 7:09 AM, Robert Moskowitz wrote:
I am trying to override the mac addr.
pretty sure you need to use NIC model specific utilities to do this, ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, not for reprogramming it.
ifconfig claims to support it:
hw class address
<snip> Also, don't forget /etc/udev/rules.d/70-persistant-net.rules
I can't forget what I don't know. please point me to description of these rules?
It's used to assign names to physical devices via udev. How it works depends a bit on your version.
It's discussed as part of these tutorials:
CentOS 6: https://alteeve.ca/w/Changing_the_ethX_to_Ethernet_Device_Mapping_in_EL6_and...
Ah. A bit:
# cat /etc/udev/rules.d/70-persistent-net.rules # This file was automatically generated by the /lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key.
# net device () SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:c4:03:82:c1:5 3", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# net device () SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:c3:04:01:77:c 3", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
===========================================
So I can pull that eth1 line that got generated error and change the eth0 line?
Well I did that, took the macaddr and hwaddr lines. restarted network and it was not finding eth0. And it added eth1 back into /etc/udev/rules.d/70-persistent-net.rules.
I cleaned that up, and rebooted. During the boot, I see the message:
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization. [FAILED]
and once I get started, ifconfig reports eth1 again, and the eth1 line got added to rules. But the network IS working with addresses I want. But on eth1 with the errors about eth0.
So there seems to be something before rules that is needed to be edited, or there is some limitation on my driver(s).
On 21/08/14 11:22 AM, Robert Moskowitz wrote:
On 08/21/2014 10:49 AM, Digimer wrote:
On 21/08/14 10:43 AM, Robert Moskowitz wrote:
On 08/21/2014 10:32 AM, m.roth@5-cent.us wrote:
Keith Keller wrote:
On 2014-08-21, John R Pierce pierce@hogranch.com wrote:
On 8/21/2014 7:09 AM, Robert Moskowitz wrote: > I am trying to override the mac addr. pretty sure you need to use NIC model specific utilities to do this, ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, not for reprogramming it.
ifconfig claims to support it:
hw class address
<snip> Also, don't forget /etc/udev/rules.d/70-persistant-net.rules
I can't forget what I don't know. please point me to description of these rules?
It's used to assign names to physical devices via udev. How it works depends a bit on your version.
It's discussed as part of these tutorials:
CentOS 6: https://alteeve.ca/w/Changing_the_ethX_to_Ethernet_Device_Mapping_in_EL6_and...
Ah. A bit:
# cat /etc/udev/rules.d/70-persistent-net.rules # This file was automatically generated by the /lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key.
# net device () SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:c4:03:82:c1:5 3", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# net device () SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:c3:04:01:77:c 3", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
===========================================
So I can pull that eth1 line that got generated error and change the eth0 line?
Well I did that, took the macaddr and hwaddr lines. restarted network and it was not finding eth0. And it added eth1 back into /etc/udev/rules.d/70-persistent-net.rules.
I cleaned that up, and rebooted. During the boot, I see the message:
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization. [FAILED]
and once I get started, ifconfig reports eth1 again, and the eth1 line got added to rules. But the network IS working with addresses I want. But on eth1 with the errors about eth0.
So there seems to be something before rules that is needed to be edited, or there is some limitation on my driver(s).
Note that you generally need to stop the network, edit the udev file and then restart the network. It will confuse the kernel otherwise.
Please also note that I've always moved names associated to devices, I've not tried changing the address, so there might be something missing there.
I just did it like this:
ifconfig enp3s0
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.241.27.154 netmask 255.255.255.0 broadcast 10.241.27.255 inet6 fe80::210:18ff:fe04:4d0 prefixlen 64 scopeid 0x20<link> ether 00:10:18:04:04:d0 txqueuelen 1000 (Ethernet) RX packets 429591 bytes 41991957 (40.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 249536 bytes 19108398 (18.2 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 18
ifconfig enp3s0 hw ether 00:10:18:04:04:d7
ifconfig enp3s0 enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.241.27.154 netmask 255.255.255.0 broadcast 10.241.27.255 inet6 fe80::210:18ff:fe04:4d0 prefixlen 64 scopeid 0x20<link> ether 00:10:18:04:04:d7 txqueuelen 1000 (Ethernet) RX packets 429615 bytes 41994383 (40.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 249549 bytes 19109350 (18.2 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 18 Done!
-GKH
On 08/21/2014 10:32 AM, m.roth@5-cent.us wrote:
Keith Keller wrote:
On 2014-08-21, John R Pierce pierce@hogranch.com wrote:
On 8/21/2014 7:09 AM, Robert Moskowitz wrote:
I am trying to override the mac addr.
pretty sure you need to use NIC model specific utilities to do this, ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, not for reprogramming it.
ifconfig claims to support it:
hw class address
<snip> Also, don't forget /etc/udev/rules.d/70-persistant-net.rules
I can't forget what I don't know. please point me to description of these rules?
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On 08/21/2014 10:56 AM, GKH wrote:
I just did it like this:
ifconfig enp3s0
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.241.27.154 netmask 255.255.255.0 broadcast 10.241.27.255 inet6 fe80::210:18ff:fe04:4d0 prefixlen 64 scopeid 0x20<link> ether 00:10:18:04:04:d0 txqueuelen 1000 (Ethernet) RX packets 429591 bytes 41991957 (40.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 249536 bytes 19108398 (18.2 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 18
ifconfig enp3s0 hw ether 00:10:18:04:04:d7
ifconfig enp3s0 enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.241.27.154 netmask 255.255.255.0 broadcast 10.241.27.255 inet6 fe80::210:18ff:fe04:4d0 prefixlen 64 scopeid 0x20<link> ether 00:10:18:04:04:d7 txqueuelen 1000 (Ethernet) RX packets 429615 bytes 41994383 (40.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 249549 bytes 19109350 (18.2 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 18 Done!
-GKH
I need the changes to be permanent to apply across boots. Thus using ifcfg-eth0 rather than ifconfig.
On 08/21/2014 10:32 AM, m.roth@5-cent.us wrote:
Keith Keller wrote:
On 2014-08-21, John R Pierce pierce@hogranch.com wrote:
On 8/21/2014 7:09 AM, Robert Moskowitz wrote:
I am trying to override the mac addr.
pretty sure you need to use NIC model specific utilities to do this, ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, not for reprogramming it.
ifconfig claims to support it:
hw class address
<snip> Also, don't forget /etc/udev/rules.d/70-persistant-net.rules
I can't forget what I don't know. please point me to description of these rules?
Robert, Sorry Dude. I did not mean to make things worse. All I wanted to say is this: It can be done via the ifconfig command.
Now,
# systemctl status network.service
Tells me that network services still depend on:
"ExecStart=/etc/rc.d/init.d/network start"
Good! File: "/etc/sysconfig/network-scripts/ifup-eth"
Says: "39 # bail out, if the MAC does not fit"
Ok, perfect. As you already guessed we need to make this change early on. However, if all else fails, you can always source a custom script here and problem solved.
I know, this is not elegant. But as an SA who sometimes needs to do dirty deeds...
Again, apologies if I am being too simplistic/stupid here.
GKH
On 08/21/2014 10:56 AM, GKH wrote:
I just did it like this:
ifconfig enp3s0
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.241.27.154 netmask 255.255.255.0 broadcast 10.241.27.255 inet6 fe80::210:18ff:fe04:4d0 prefixlen 64 scopeid 0x20<link> ether 00:10:18:04:04:d0 txqueuelen 1000 (Ethernet) RX packets 429591 bytes 41991957 (40.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 249536 bytes 19108398 (18.2 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 18
ifconfig enp3s0 hw ether 00:10:18:04:04:d7
ifconfig enp3s0 enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.241.27.154 netmask 255.255.255.0 broadcast 10.241.27.255 inet6 fe80::210:18ff:fe04:4d0 prefixlen 64 scopeid 0x20<link> ether 00:10:18:04:04:d7 txqueuelen 1000 (Ethernet) RX packets 429615 bytes 41994383 (40.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 249549 bytes 19109350 (18.2 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 18 Done!
-GKH
I need the changes to be permanent to apply across boots. Thus using ifcfg-eth0 rather than ifconfig.
On 08/21/2014 10:32 AM, m.roth@5-cent.us wrote:
Keith Keller wrote:
On 2014-08-21, John R Pierce pierce@hogranch.com wrote:
On 8/21/2014 7:09 AM, Robert Moskowitz wrote: > I am trying to override the mac addr. pretty sure you need to use NIC model specific utilities to do this, ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, not for reprogramming it.
ifconfig claims to support it:
hw class address
<snip> Also, don't forget /etc/udev/rules.d/70-persistant-net.rules
I can't forget what I don't know. please point me to description of these rules?
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On 08/21/2014 11:47 AM, GKH wrote:
Robert, Sorry Dude. I did not mean to make things worse. All I wanted to say is this: It can be done via the ifconfig command.
Now,
# systemctl status network.service
This tells me you are not using Centos6 which does not have systemd. Or at least not my systems.
Tells me that network services still depend on:
"ExecStart=/etc/rc.d/init.d/network start"
Good! File: "/etc/sysconfig/network-scripts/ifup-eth"
Says: "39 # bail out, if the MAC does not fit"
Ok, perfect. As you already guessed we need to make this change early on. However, if all else fails, you can always source a custom script here and problem solved.
I hope to get a conf file setup to do the work.
I know, this is not elegant. But as an SA who sometimes needs to do dirty deeds...
Again, apologies if I am being too simplistic/stupid here.
GKH
On 08/21/2014 10:56 AM, GKH wrote:
I just did it like this:
ifconfig enp3s0
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.241.27.154 netmask 255.255.255.0 broadcast 10.241.27.255 inet6 fe80::210:18ff:fe04:4d0 prefixlen 64 scopeid 0x20<link> ether 00:10:18:04:04:d0 txqueuelen 1000 (Ethernet) RX packets 429591 bytes 41991957 (40.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 249536 bytes 19108398 (18.2 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 18
ifconfig enp3s0 hw ether 00:10:18:04:04:d7
ifconfig enp3s0 enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.241.27.154 netmask 255.255.255.0 broadcast 10.241.27.255 inet6 fe80::210:18ff:fe04:4d0 prefixlen 64 scopeid 0x20<link> ether 00:10:18:04:04:d7 txqueuelen 1000 (Ethernet) RX packets 429615 bytes 41994383 (40.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 249549 bytes 19109350 (18.2 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 18 Done!
-GKH
I need the changes to be permanent to apply across boots. Thus using ifcfg-eth0 rather than ifconfig.
On 08/21/2014 10:32 AM, m.roth@5-cent.us wrote:
Keith Keller wrote:
On 2014-08-21, John R Pierce pierce@hogranch.com wrote: > On 8/21/2014 7:09 AM, Robert Moskowitz wrote: >> I am trying to override the mac addr. > pretty sure you need to use NIC model specific utilities to do this, > ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, > not for reprogramming it. ifconfig claims to support it:
hw class address
<snip> Also, don't forget /etc/udev/rules.d/70-persistant-net.rules
I can't forget what I don't know. please point me to description of these rules?
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Deleted all the back-and-forthing and will only include what finally worked. Sheesh, I got buried in the cruft on this one.
Edit /etc/udev/rules.d/70-persistent-net.rules to have your REAL mac addr:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:c3:04:01:77:c3", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Edit /etc/sysconfig/network-scripts/ifcfg-eth0 with the mac addr you want:
MACADDR=02:67:15:00:01:79
REBOOT!
running start_udev at this point only added the eth1 entry again. The kernel was so confused that I needed to 'clean house'.
# ifconfig eth0 Link encap:Ethernet HWaddr 02:67:15:00:01:79 inet addr:208.83.67.179 Bcast:208.83.67.255 Mask:255.255.255.0 inet6 addr: 2607:f4b8:3:3:67:15ff:fe00:179/64 Scope:Global inet6 addr: fe80::67:15ff:fe00:179/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:134 errors:0 dropped:11 overruns:0 frame:0 TX packets:77 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:16489 (16.1 KiB) TX bytes:6313 (6.1 KiB) Interrupt:87 Base address:0x6000
I got my desired MAC addr, my static IPv4 addr, and IPv6 RA + MAC = desired IPv6 addr.
Now to reveal why I went to these efforts. STATIC IPv6 is badness when you want to be able to change prefixes but have 'nice' IPv6 addresses. So I studied how IPv6 suffixes are currently constructed, decided what I wanted, and off to the races.
Well another reason, is I will be working in IEEE 802 MAC privacy Study Group, and wanted to see what COULD be done to create privacy-enhancing MAC addresses.
But thank you ALL for your efforts!
Robert Moskowitz wrote:
On 08/21/2014 10:32 AM, m.roth@5-cent.us wrote:
Keith Keller wrote:
On 2014-08-21, John R Pierce pierce@hogranch.com wrote:
On 8/21/2014 7:09 AM, Robert Moskowitz wrote:
I am trying to override the mac addr.
pretty sure you need to use NIC model specific utilities to do this, ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, not for reprogramming it.
ifconfig claims to support it:
hw class address
<snip> Also, don't forget /etc/udev/rules.d/70-persistant-net.rules
I can't forget what I don't know. please point me to description of these rules?
Trying again, after those idiots at Ix who run manitu blocked me....
/etc/udev/rules.d are configuration files for udev, to create at boot. 70-persistent-net.rules contains MAC addresses....
mark
On 08/21/2014 11:17 AM, m.roth@5-cent.us wrote:
Robert Moskowitz wrote:
On 08/21/2014 10:32 AM, m.roth@5-cent.us wrote:
Keith Keller wrote:
On 2014-08-21, John R Pierce pierce@hogranch.com wrote:
On 8/21/2014 7:09 AM, Robert Moskowitz wrote:
I am trying to override the mac addr.
pretty sure you need to use NIC model specific utilities to do this, ifcfg-ethN won't do it. the hwaddr= in there is for finding the nic, not for reprogramming it.
ifconfig claims to support it:
hw class address
<snip> Also, don't forget /etc/udev/rules.d/70-persistant-net.rules
I can't forget what I don't know. please point me to description of these rules?
Trying again, after those idiots at Ix who run manitu blocked me....
/etc/udev/rules.d are configuration files for udev, to create at boot. 70-persistent-net.rules contains MAC addresses....
While they were blocking you, my search foo finally started getting results and others posted more help. I have learned more, but not working as I think it should. Working strangely; why the eth1 stuff.