0

Ubuntu beginner trying to improve Linux / Ubuntu skills.

I've setup a new VM and trying to configure a static IP.

When I set a new static IP on ubuntu (/etc/network/interfaces)I have to reset it's MAC address in order for it to work (restarting the network service won't work). Is there a way to remove MAC address association like in CentoOS ?

Thanks and regards, J

6
  • What do you mean by "reset its MAC address"? Normally you just add the interface to /etc/network/interfaces with a static IP address and reboot.
    – AlexP
    Nov 28, 2016 at 22:28
  • I'm trying to eliminate the part where you 'reboot'. In ubuntu 14.04 a simple /etc/init.d/networking restart applies the new IP configuration however on 16.04 this is not possible. On CentOS it was possible to eliminate the HWADDR from the /etc/sysconfig/network-scripts/ifcfg-eth0 file, however it does not seem to be possible in ubuntu Nov 28, 2016 at 22:39
  • That's tricky. Adding an interface to /etc/network/interfaces takes it out of the realm of NetworkManager. I haven't tried it, but the following sequence may work: down the interface, stop NetworkManager (which still manages the interface), add the stanza to /etc/network/interfaces, start Network Manager (now no longer attempts to manage the interface), up the interface.
    – AlexP
    Nov 28, 2016 at 22:51
  • @AlexP Network manager is not currently installed (I'm using a minimal version of Ubuntu 16.04 and network manager doesn't seem to be pre-installed). Nov 29, 2016 at 6:14
  • And what happens if you sudo systemctl restart network? Or just ifdown, ip addr flush dev, ifup?
    – AlexP
    Nov 29, 2016 at 7:27

1 Answer 1

0

Since you have a minimal install with no NetworkManager, you can restart your network interface by running ifdown, ip addr flush dev and ifup on the interface in this sequence. You may want to take the relevant precautions if you are connected through SSH...

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .