ubuntu16.04 网卡设置

1.查看网卡名称

ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:50:56:b5:b2:cb brd ff:ff:ff:ff:ff:ff
#网卡名称ens160

2、修改网卡配置

sudo nano /etc/network/interfaces.d/ens160

动态IP配置

auto ens160
iface ens160 inet dhcp

静态IP配置

auto ens160
iface ens160 inet static
        address 172.16.25.96
        netmask 255.255.255.0
        gateway 172.16.25.2
        dns-nameservers 172.16.25.225

3、重启网络服务

sudo systemctl restart networking

展开阅读全文

没有更多推荐了,返回首页