< Previous | Contents | Next >
To configure networking, edit /etc/network/interfaces, /etc/resolv.conf,
/etc/hostname and /etc/hosts.
# editor /etc/network/interfaces
Here are some simple examples from /usr/share/doc/ifupdown/examples:
######################################################################
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# See the interfaces(5) manpage for information on what options are
# available.
######################################################################
# We always want the loopback interface.
#
auto lo
iface lo inet loopback
# To use dhcp:
#
# auto eth0
# iface eth0 inet dhcp
# An example static IP setup: (broadcast and gateway are optional)
#
# auto eth0
# iface eth0 inet static
# address 192.168.0.42
# network 192.168.0.0
# netmask 255.255.255.0
# broadcast 192.168.0.255
# gateway 192.168.0.1
Enter your nameserver(s) and search directives in /etc/resolv.conf:
# editor /etc/resolv.conf
A simple example /etc/resolv.conf:
search hqdom.local nameserver 10.1.1.36
nameserver 192.168.9.100
Enter your system’s host name (2 to 63 characters):
# echo UbuntuHostName > /etc/hostname
And a basic /etc/hosts with IPv6 support:
127.0.0.1 localhost
127.0.1.1 UbuntuHostName
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
If you have multiple network cards, you should arrange the names of driver modules in the
/etc/modules file into the desired order. Then during boot, each card will be associated with the interface name (eth0, eth1, etc.) that you expect.
D.4.4.7. Configure Locales and Keyboard