How do I set a static IP address?
You don't really need to edit `/etc/network/interfaces' to set the static IP addresses. You can do that using the Network Manager. Just right click on the network applet and go to Edit Connections.
If you however don't want to use the network manager, the following steps will help you assign multiple ip addresses:
- Disable the network manager
sudo service network-manager stop
- Get the IP address from the server using:
sudo dhclient eth0
- Assign the first ip addresses like this:
sudo ip addr add 192.168.20.222/24 dev eth0
, and repeat for other IP addresses. - Add the default route using:
sudo route add default gw <internet gateway ip address>
If you do step 2, step 4 is not required. Hope that helps.
If you have NetworkManager installed, it could be causing a problem with /etc/network/interfaces. See /usr/share/doc/network-manager/README.Debian (I've used Ubuntu just enough to install it for someone else).
If the problem persists while setting up a static ip, use the following steps to set up a new static ip address:
Open terminal (command line) and type the following command:
sudo vi /etc/network/interfaces
OR
sudo gedit /etc/network/interfaces
Make the changes as follows:
auto eth0
iface eth0 inet static
address 10.10.29.66
netmask 255.255.255.192
network 10.10.29.65
broadcast 10.10.29.127
gateway 10.10.29.65
Save and close the file. Restart networking:
sudo /etc/init.d/networking restart