- 论坛徽章:
- 0
|
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
完毕后重新启动网络
[color="#800080"]#/etc/init.d/networking restart
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/59015/showart_2070482.html |
|