1. #ifconfig

ubuntu配置静态路由

注意 eth0为你要配置的interfase

2. #vi /etc/network/interfaces

# 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 dhcp

很明显看到eth0为dhcp模式,动态分配ip

改为

auto eth0
iface eth0 inet static
address 10.0.0.160
gateway 10.0.0.1
netmask 255.255.255.0

注意:网关和掩码要和主机上的桥接网路一致

3.#service networking restart

4.最好还是重启下虚拟机

相关文章:

  • 2021-04-22
猜你喜欢
  • 2022-12-23
  • 2022-01-08
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
相关资源
相似解决方案