debian中设置IP
Debian 503版本。
vhost:/# cd /etc/network
vhost:/etc/network# vi interface
# 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
iface eth0 inet static
address 203.171.237.26
netmask 255.255.255.224
network 203.171.237.0
broadcast 203.171.237.31
gateway 203.171.237.1
auto eth0:0
iface eth0:0 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
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 202.102.224.68
dns-search vpsbbs.com
假如你要再加一个IP可以如下配置文件
# 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
iface eth0 inet static
address 203.171.237.26
netmask 255.255.255.224
network 203.171.237.0
broadcast 203.171.237.31
gateway 203.171.237.1
auto eth0:0
iface eth0:0 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
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 202.102.224.68
dns-search vpsbbs.com
完毕后重新启动网络
#/etc/init.d/networking restart
阅读(1679) | 评论(0) | 转发(0) |