ifconfig enp2s0:3192.168.3.152 netmask 255.255.255.0 up
TYPE=Ethernet
BOOTPROTO=none
NAME=enp2s0
DEVICE=enp2s0
HWADDR=40:8d:5c:bc:f4:d8
ONBOOT=yes
IPADDR0=192.168.3.200
PREFIX0=24
GATEWAY0=192.168.3.254
IPADDR1=192.168.3.164
PREFIX1=24
IPADDR2=192.168.3.250
PREFIX2=24
IPADDR3=192.168.3.152
PREFIX3=24
note:
(1) Only when multiple IPs are configured, IPADDR can be followed by a number
(2) Permanent effect can also be added by means of network card IP alias, that is, copy the network card configuration as an alias, rename the configuration of the network card alias, modify the configuration, and then restart the network.
The disadvantage is that there are more network card configuration files than the above method, and the configuration is relatively cumbersome.
(3) Restart the network card command: service network restart
Recommended Posts