- Open the configuration file in your favorite editor (mine is nano)
sudo nano /etc/network/interfaces
- Comment out the section where dhcp is being used (put the # in front of the line):
#auto eth1
#iface eth1 inet dhcp - Add a section like this example:
auto eth1
iface eth1 inet static
address 192.168.0.101
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1 - Close and save the file
- Reload the network service:
sudo /etc/network restart
- Check to make sure you can access other computers/internet by using ping:
ping www.google.com
- If you don't get a response then you may have set your network information incorrectly. Just go back and repeat this process at step 3.
Rabu, 21 Januari 2009
Create a Static IP from the Command Line
Creating a static IP from the command line is a very short task. All you need to edit is one configuration file and restart the networking service. You will need to know the settings for your network to do this. I will show how to set a static IP of 192.168.0.101 on a network with a gateway of 192.168.0.1.
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar