debian linux靜態IP設置。
今天發現服務器的一個磁盤滿了,於是就上網找方法吧其它盤的空間移動一些過去,結果fdisk時誤刪了一個分區,導致數據丟失,還好沒有什麼重要的 東西…於是只好重新安裝系統了,本來還想嘗試恢復回去呢,發現不是一點兩點的只是要補充,於是當務之急只好先把新的系統安裝上去,以後有機會再研究了~
debian系統默認使用的dhpc服務,如果做爲服務器使用肯定是要手動配置一下靜態IP。
靜態IP設置:
bjcl:~# vi /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
#auto lo
#iface lo inet loopback
# The primary network interface
auto eth0
#allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
bjcl:~# /etc/init.d/networking restart
Reconfiguring network interfaces...done.
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
#auto lo
#iface lo inet loopback
# The primary network interface
auto eth0
#allow-hotplug eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
bjcl:~# /etc/init.d/networking restart
Reconfiguring network interfaces...done.
DNS服務器設置:
bjcl:~# vi /etc/resolv.conf
nameserver 192.168.1.10
nameserver 202.106.46.151
nameserver 192.168.1.10
nameserver 202.106.46.151