 Site Admin
Joined: 10 Dec 2007 Posts: 143 Location: New Zealand
|
Here are the easy steps to assign static IP address from command line:
1. Run sudo -s to configure everything as a root user (if you have permission).
2. Goto /etc/network directory
3. Open interfaces file
4. You will see the following lines if you're getting IP address from DHCP
| Code: | auto eth0
iface eth0 inet dhcp |
5. Change iface eth0 inet dhcp to following:
| Code: | iface eth0 inet static
address 192.168.0.10
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
|
6. Save interfaces
7. run /etc/init.d/networking restart.
In above example, we have assigned static IP address of 192.168.0.10 with gateway 192.168.0.1. _________________ Paul KH Kim
http://www.onlinesolution.co.nz |
|