Instructions:
- Bring-up the Console Terminal of the Ubuntu Linux and Running ifconfig -a will show you what network interfaces are available.
- Internal Network Information: Router: Address: 192.168.1.1, Network: 192.168.1.0, Netmask: 255.255.255.0, Broadcast: 192.168.1.255 and Clients: Addresses: 192.168.1.2 - 192.168.1.254, Netmask: 255.255.255.0, Broadcast: 192.168.1.255, Gateway: 192.168.1.1
- Setting up network interfaces: Device Naming: eth0 = external and eth1 = internal.
- Take a backup of your current network configuration: sudo cp /etc/network/interfaces /etc/network/interfaces.bak
- Configuring the External Network Interface:
- For Dynamic IP Addresses (DHCP) Only:
- Open /etc/network/interfaces with your favourite editor. Delete everything and paste in what is below. Follow the commented out instructions carefully.
# Set up the local loopback interface
auto lo
iface lo inet loopback
# Set up the external interface
#
# Don't forget to change eth0 to the proper name of the external
# interface if applicable.
#
auto eth0
iface eth0 inet dhcp
- Open /etc/network/interfaces with your favourite editor. Delete everything and paste in what is below. Follow the commented out instructions carefully.
- For Static IP Addresses Only
- Open /etc/network/interfaces with your favourite editor. Delete everything and paste in what is below. Follow the commented out instructions carefully.
# Set up the local loopback interface
auto lo
iface lo inet loopback
# Set up the External interface
#
# For every xxx.xxx.xxx.xxx, enter the numeric address given to you
# by your Internet provider. Don't forget to change eth0 to the proper
# name of the external interface if applicable.
#
auto eth0
iface eth0 inet static
address xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
Now, set up your DNS servers as given to you by your service provider in /etc/resolv.conf, which should look something like this
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx - Testing Connectivity: Reload the network configuration and test for connectivity,
sudo /etc/init.d/networking restart
ping -c 3 -W 10 ubuntu.com - Configuring the Internal Network Interfaces
- Wired Only
- Append the following to /etc/network/interfaces and follow the commented out instructions carefully.
# Set up the internal wired network
#
# Don't forget to change eth1 to the proper name of the internal
# wired network interface if applicable.
#
auto eth1
iface eth1 inet static
address 192.168.1.1
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
- Append the following to /etc/network/interfaces and follow the commented out instructions carefully.
- Restart Networking Now, if the following command is executes successfully, your networking devices have been properly configured.
sudo /etc/init.d/networking restart