Debian / Ubuntu Linux Static IP Configuration
Edit /etc/hostname, enter:
# cat /etc/hostname
Sample ip config:
server1.cyberciti.biz
Edit /etc/network/interfaces, enter:
# cat /etc/network/interfaces
Sample static ip config:
iface eth0 inet static
address 192.168.1.10
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.254
Edit /etc/resolv.conf and setup DNS servers, enter:
# cat /etc/resolv.conf
Sample dns static IP configurations:
search cyberciti.biz
nameserver 192.168.1.254
nameserver 8.8.8.8
nameserver 202.54.2.5
Finally, you need to restart the networking service under Debian / Ubuntu Linux, enter:
# /etc/init.d/networking restart
Type the following commands to verify your new setup, enter:
# ifconfig eth0
# route -n
# ping google.com
Niciun comentariu:
Trimiteți un comentariu