Modifying Network Settings in Debian and Ubuntu

Unix

09 Feb 2015

Modifying Network Settings in Debian and Ubuntu

Preston Garrison 0 Comments

Its very easy to add more the one ip, or modify the network settings directly in both Debian and Ubuntu.  Just edit interfaces file

 

nano -w /etc/network/interfaces

 

 

 

 

Now add your interfaces like the following

auto eth0
iface eth0 inet static
       address 192.168.0.44
       netmask 255.255.255.0
       gateway 192.168.0.1

 

 

eth0 should be replaced with the device name of your network card.  To add additional ips you can use the following formats

 

auto eth0:0
iface eth0:0 inet static
        address 192.168.0.45
        netmask 255.255.255.255

auto eth0:1
iface eth0:1 inet static
        address 192.168.0.46
        netmask 255.255.255.255

 

 

increasing the number after eth0 with each additional ip.  Be VERY careful to not duplicate any of these lines, or your PC will not boot.

 

 

If you wish to just use DHCP for your main interface you can do so with the following

 

auto eth0
iface eth0 inet dhcp

 

Preston Garrison