Debian and Ubuntu Networking Configuration /etc/network/interfaces with a Static IP Address

This is easy to find anywhere, and it’s here too. This one includes the dns-* lines that will be read by resolvconf(8).

root@server:/etc/network# cat interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
dns-search mydomain.local

Also, here’s a cheatsheet for setting that netmask:  /30    2  nodes  /29    6  nodes  /28   14  nodes  /27   30  nodes  /26   62  nodes  /25  126  nodes    /24 "Class C" 254 nodes

Note that the number of nodes is the total number of addresses, less two. It’s less two because the lowest value is the address of the entire network. The highest value is the broadcast address. So if the netmask is 0, then the lowest value is 0, and that’s the address of the network, and the highest value is 255, which is the broadcast address.

Was this helpful?

0 / 0

Leave a Reply