小编iAs*_*Ask的帖子

如何设置静态IP地址?

我的 eth0 使用 DHCP 来获取互联网的 IP 地址。但是我仍然需要为我的 LAN 设置一些静态 IP。以下是我在 /etc/network/interface 中的设置。剧本有问题吗?当我尝试启动网络时,我总是失败。

我通过ifconfig检查了IP。发现 eth0:3 已设置,但其他。我可以知道有什么问题吗?

  1 auto lo
  2 iface lo inet loopback
  3 
  4 #auto eth0
  5 #iface eth0 inet dhcp
  6 
  7 auto eth0:1
  8 iface eth0:1 inet static
  9 address 192.168.20.222
 10 netmask 255.255.255.0
 11 gateway 192.168.20.1
 12 
 13 auto eth0:2
 14 iface eth0:2 inet static
 15 address 192.168.30.222
 16 netmask 255.255.255.0
 17 gateway 192.168.30.1
 18 
 19 auto eth0:3
 20 iface eth0:3 inet static
 21 address 192.168.211.222 …
Run Code Online (Sandbox Code Playgroud)

networking ip-address

5
推荐指数
2
解决办法
4万
查看次数

标签 统计

ip-address ×1

networking ×1