# 查看网卡的IP地址分配
$ ip address
配置文件 /etc/network/interfaces
配置了一个DHCP,两个固定IP
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# BFY add DHCP config
auto enp3s0
allow-hotplug enp3s0
iface enp3s0 inet dhcp
iface enp3s0 inet6 dhcp
auto enp3s0:0
allow-hotplug enp3s0:0
iface enp3s0:0 inet static
address 192.168.1.90
netmask 255.255.255.0
auto enp3s0:1
allow-hotplug enp3s0:1
iface enp3s0:1 inet static
address 192.168.1.91
netmask 255.255.255.0
启停新的IP
$ sudo ifup enp3s0:0
$ sudo ifdown enp3s0:0
网友评论