首页 > 代码库 > ubuntu 绑定固定ip

ubuntu 绑定固定ip

cd /etc/network

sudo vi interfaces

在文件中输入如下内容:

auto eth0

iface eth0 inet static

address 192.168.1.1

netmask 255.255.255.0

gateway 192.168.1.254

 

auto eth0:0

iface eth0:0 inet static

address 192.168.1.2

netmask 255.255.255.0

gateway 192.168.1.254

ubuntu 绑定固定ip