在debian中,IP地址的配置参数在/etc/network/目录下的interface中,而DNS的配置参数在/etc目录下的resolv.conf中,下面是配置参数的说明:

========================

IP地址设置: /etc/network/interface

// 动态DHCP获得

# 启动系统激活设备
# Loop回环地址
auto lo
iface lo inet loopback

# 启动系统激活设备
# 网卡eth0设置为DHCP类型
auto eth0
iface eth0 inet dhcp

// 静态Static获得

# 启动系统激活设备
# Loop回环地址
auto lo
iface lo inet loopback

# 启动系统激活设备
# 网卡eth0设置为Static类型
auto eth0
iface eth0 inet static

# 指定IP地址、子网掩码、网关
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.1

注:在配置IP地址参数时,“// 动态DHCP获得”和“// 静态Static获得”只能取其中的一种,二者不能同时存在,切记!!!

========================

DNS服务器设置: /etc/resolv.conf
# 必须设置.否则无法访问任何URL

nameserver 202.103.0.117

nameserver 211.95.193.97

========================

重启网卡

/etc/init.d/networking restart
    ifdown eth0
    ifup eth0

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2021-09-30
  • 2021-12-06
  • 2021-12-29
  • 2021-05-24
猜你喜欢
  • 2021-10-30
  • 2022-12-23
  • 2021-05-01
  • 2022-12-23
  • 2021-08-05
  • 2022-01-07
  • 2022-01-07
相关资源
相似解决方案