Recently I needed to change the existing ipaddress of a linux machine. Since we migrated to our machines in to new cloud servers.
Just follow the steps defined below:
- On terminal window type the following command.
or
sudo gedit /etc/network/interfaces
- Then find the eth0 section and set the ipaddress as below
iface eth0 inet static
address 192.168.10.43
netmask 255.255.255.0
network 192.168.10.46
broadcast 255.255.255.0
Note: Its my own ipaddresses, you have to define your own addresses.
- In above file may have " iface eth0 inet dhcp". when you want to define static ip you have to change it to "static". "dhcp" is for dynamic ipaddress.
- Then save and close the file, then run the restart the network with this command.
- To ensure ipaddress has been changed just run the command.
Comments
Post a Comment