View unanswered posts | View active topics It is currently Sun Jul 21, 2019 5:29 pm



Reply to topic  [ 7 posts ] 
 Eth0 Mac Address Changes for Every Boot 
Author Message

Joined: Mon Jan 09, 2012 3:16 am
Posts: 351
Post Eth0 Mac Address Changes for Every Boot
When running Linaro on my Utilite2, the mac address for eth0 changes for every boot. I have searched the net for this issue and have located a possible solution here, but I haven't tried it yet.

See:

http://ubuntuforums.org/showthread.php?t=1647460


I understand that viewtifuldave is also experiencing the changing mac address. Is anyone else seeing this behavior?

Does anyone have a fix?

Best regards,

hassellbear


Fri Jun 19, 2015 11:30 pm
Profile

Joined: Thu Sep 25, 2014 9:43 am
Posts: 37
Post Re: Eth0 Mac Address Changes for Every Boot
I can confirm this problem. It is annoying as there is a MAC address filtering at my workplace.
I tried to force a MAC address in the Network Manager, but sometimes it creates a new connection ("Wireless Connection X+1") with the same random MAC address, that I have to change back again to fixed.
Now, as a workaround, I set all the network configuration in /etc/network/interfaces; so the solution described in the Ubuntu forum works.
I hope there will be an official patch for this problem.


Mon Jun 22, 2015 1:09 pm
Profile

Joined: Tue May 19, 2015 4:44 pm
Posts: 21
Post Re: Eth0 Mac Address Changes for Every Boot
Here is how I fixed my problem.

For the file "/etc/NetworkManager/NetworkManager.conf" I changed the line managed=true to managed=false.

Then I edited "/etc/network/interfaces" :
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
hwaddress xx:xx:xx:xx:xx:xx

Finally set a dhcp reservation for the MAC address.

So far so good. The MAC address always stays the same.


Tue Jul 21, 2015 3:10 pm
Profile

Joined: Thu Sep 25, 2014 9:43 am
Posts: 37
Post Re: Eth0 Mac Address Changes for Every Boot
I'm using the same method.
However the random MAC thing is a bug and it should be fixed.
I don't really like setting the ethernet network in /etc/network/interfaces: if it's set to DHCP and the ethernet is unplugged, the computer takes 2 minutes to start.


Tue Jul 21, 2015 3:52 pm
Profile

Joined: Tue May 19, 2015 4:44 pm
Posts: 21
Post Re: Eth0 Mac Address Changes for Every Boot
I still have a problem with the ethernet connection.

Still using the same configuration, if I reboot everything is fine. If I unplug then plug back, the ethernet does not reconnect automatically. In the notification area, I have to select the network icon then select Auto Ethernet.

Is there a way to let the system connect automatically? I want to use the system headless, so having to manually reconnect is not a good solution.
I tried to unplug and plug back the ethernet cable, with no success.


Mon Jul 27, 2015 12:44 pm
Profile

Joined: Thu Sep 25, 2014 9:43 am
Posts: 37
Post Re: Eth0 Mac Address Changes for Every Boot
I didn't try it, but maybe you don't get a new IP address from the DHCP server. When you replug the ethernet cable, try:
Code:
sudo dhclient eth0

I don't know how to start dhclient automatically when the ethernet cable is plugged in, try to search other forums.

If you can assign a fixed IP address for your Utilite, it might be the easiest solution for this problem. Instead of:
Code:
iface eth0 inet dhcp
hwaddress xx:xx:xx:xx:xx

try:
Code:
iface eth0 inet static
hwaddress xx:xx:xx:xx:xx
address xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx

Does this solve your problem?


Mon Jul 27, 2015 1:23 pm
Profile

Joined: Tue May 19, 2015 4:44 pm
Posts: 21
Post Re: Eth0 Mac Address Changes for Every Boot
I did it!
I'm able to keep the same mac address and IP address after each reboot, shutdown or power loss.

Here is how I did it.

/etc/NetworkManager/NetworkManager.conf : Reverting back to managed=true
Code:
      [main]
      plugins=ifupdown,keyfile,ofono
      dns=dnsmasq
      
      [ifupdown]
      managed=true


/etc/network/interfaces : Setting eth0 to dhcp then forcing the mac address
Code:
      auto lo
      iface lo inet loopback
      
      auto eth0
      iface eth0 inet dhcp
      hwaddress 00:00:00:00:00:00


/etc/rc.local : Adding "sudo dhclient eth0" at the end, before "exit 0"
Code:
      #!/bin/sh -e
      #
      # rc.local
      #
      # This script is executed at the end of each multiuser runlevel.
      # Make sure that the script will "exit 0" on success or any other
      # value on error.
      #
      # In order to enable or disable this script just change the execution
      # bits.
      #
      # By default this script does nothing.
      
      # Generate the SSH keys if non-existent
      test -f /etc/ssh/ssh_host_dsa_key || dpkg-reconfigure openssh-server
      
      # Auto start dhcp
      sudo dhclient eth0
      
      exit 0



Thank you kbarni and hassellbear for your help. Much appreciated.


Mon Jul 27, 2015 3:05 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.