35

I messed up my network configuration. Can anyone help me and copy the default /etc/network/interfaces?

32

For eth0 with dhcp:

# The loopback network interface
auto lo eth0
iface lo inet loopback

# The primary network interface
iface eth0 inet dhcp

For eth0 static:

# The loopback network interface
auto lo eth0
iface lo inet loopback

# The primary network interface
iface eth0 inet static
    address 192.168.10.33
    netmask 255.255.255.0
    broadcast 192.168.10.255
    network 192.168.10.0
    gateway 192.168.10.254 
dns-nameservers 192.168.10.254

link: http://www.iasptk.com/ubuntu/20202-ubuntu-server-networking-configuration-dhcp-address-static-ip-address-second-ip-address-or-virtual-ip-address

  • 1
    So what do I do if mine has no primary network interface, just has iface lo inet loopback ?? – IgorGanapolsky Mar 31 '15 at 18:42
  • You have to add a primary (dhcp OR static) adding the lines above – ptheo Apr 1 '15 at 19:04
  • What if I don't add 'network' and 'broadcast' entries? Will the default to the reasonable values? – JohnyTex Sep 27 '18 at 9:12
9

Mine looks like:

auto lo
iface lo inet loopback
6

Following the Debian network configuration page, if you're just using DHCP then all you need is something like:

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

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.