- (Examples with eth0)
- Examples of network configuration files.
- In /etc/network/interfaces
- With DHCP
#The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
- With static IP
iface eth0 inet static
address <IP ADDRESS>
netmask <SUBNET MASK>
network <NETWORK ADDRESS>
broadcast <BROADCAST ADDRESS>
gateway <GATEWAY ADDRESS>
- DNS servers. In /etc/resolv.conf
- Adding default address to local route table. Enter: sudo route add default gw <GATEWAY ADDRESS>
- Restart eth0
- ifdown eth0
- ifup eth0