0

Changes under /etc/network/interfaces are not considered.

This is set :

auto eth0
iface eth0 inet static
address 192.168.202.131
netmask 255.255.255.0
gateway 192.168.202.2
dns-nameservers 8.8.8.8

But after reboot, if I do ifconfig, I still have the old ens33 :

ens33     Link encap:Ethernet  HWaddr 00:0c:29:f9:a7:4a
      inet addr:192.168.93.135  Bcast:192.168.93.255  Mask:255.255.255.0
      inet6 addr: fe80::90ab:97d4:31ea:245a/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:214 errors:0 dropped:0 overruns:0 frame:0
      TX packets:136 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:21403 (21.4 KB)  TX bytes:13645 (13.6 KB)

Why is that ?

  • 3
    ... your interface isn't called eth0 – steeldriver Jan 5 '17 at 2:53
  • @steeldriver what's the name, "ens33" ? – George Udosen Jan 5 '17 at 3:08
  • Yes it seems so - however if this is a desktop version of Ubuntu, you should probably be setting up the interface via the GUI applet, rather than by editing the interfaces file – steeldriver Jan 5 '17 at 3:11
  • If you want to turn off Predictive names so you can go back to eth0, check askubuntu.com/a/867533/231142 – Terrance Jan 5 '17 at 3:25
4

It does that because the /etc/network/interfaces file is only for editing current interfaces. You cannot create a new interface or rename an interface from it.

The correct settings that your gonna wanna use is this:

auto ens33
iface ens33 inet static
address 192.168.202.131 
netmask 255.255.255.0
gateway 192.168.202.2 
dns-nameservers 8.8.8.8

The name of the interface being configured in this case is ens33. You can get that information form your ifconfig command. The ens33 on the left of the readout is the name of your interface. This could be eth0, wl0, ens33, etc... The name itself is dynamic and is different for different interfaces (each interface has to be unique, E.g. eth0, eth1 for Ethernet ports 1 and 2). In later versions of Ubuntu the naming schema changed, now eth0, etc... is a fall back if it cannot reliably name an interface.


links:

If you want to rename your interface, checkout this link: https://askubuntu.com/a/689143/180773 (warning, advanced)


Tl;Dr:

The interface name is incorrect for your interfaces file.

|improve this answer|||||
  • thanks! I'll check out the link about renaming an interface – trogne Jan 5 '17 at 3:10
  • Awesome, you are most likely not going to need to change your interface name. If I answered your question please mark it as solved. Thanks! – Elliot Labs LLC Jan 5 '17 at 3:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.