Ubuntu内网、外网网络IP地址配置

首先切换到root用户:sudo su 

修改网络配置文件:vi  /etc/network/interfaces

---配置一个ip静态ip地址,配置如下:
auto lo
iface lo inet loopback
auto eth0
iface eth inet static
address 192.168.1.11
netmask 255.255.255.0
gateway 192.168.1.1

如果eth0是自动获取IP,那么配置如下

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
---配置两个网络
auto eth0
iface eth0 inet static
address 192.168.0.13
netmask 255.255.225.0
auto eth1
iface eth1 inet static
address 192.168.1.22
netmask 255.255.225.0
gateway 192.168.1.1

猜你喜欢

转载自www.cnblogs.com/fan-xiong/p/8981208.html