I messed up my network configuration. Can anyone help me and copy the default /etc/network/interfaces
?
Asked
Active
Viewed 2e+01k times
44
-
More about loopback : http://askubuntu.com/questions/247625/what-is-the-loopback-device-and-how-do-i-use-it – find_x Oct 25 '15 at 20:37
4 Answers
40
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

ptheo
- 1,676
-
1So what do I do if mine has no primary network interface, just has iface lo inet loopback ?? – IgorGanapolsky Mar 31 '15 at 18:42
-
-
What if I don't add 'network' and 'broadcast' entries? Will the default to the reasonable values? – JohnyTex Sep 27 '18 at 09:12
-
As reference, this answer shows how to find the network device name - as
eth0
is no longer that common. – s3dev Jul 31 '23 at 09:36
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

Luís de Sousa
- 13,227
- 26
- 81
- 128

Yoga
- 161
- 1
- 3
0
Here are the default contents of /etc/network/interfaces
:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback