- 论坛徽章:
- 0
|
debian默认的网络设置一般是dhcp,启动的时候感觉不爽,如果网络不通,DHCP会反复测试,浪费时间,早就想把DHCP关掉,用静态IP,一直拖着没做,现在把设置方法记录一下,以便以后参考:
1. 修改 /etc/network/interfaces
1)如果设成DHCP:
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
2)如果设成静态IP :
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.20.55
netmask 255.255.224.0
gateway 192.168.10.254
2. 修改 /etc/resolv.conf
如果以前的是dhcp设置,这个不需修改,起码我的机器上是这样,已经自动获取了域名服务器的地址
search xx.com
nameserver xx.xx.xx.xx
nameserver xx.xx.xx.xx
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/16231/showart_89703.html |
|