centos7多网卡配置

2020-10-09 16:05:40 浏览数 (2)

1.复制一个配置为对应网卡名字

2.查看UUID的对应信息: nmcli conn

代码语言:javascript复制
[root@localhost network-scripts]# nmcli conn
NAME        UUID                                  TYPE      DEVICE 
有线连接 1  e9fd0702-082b-3a3b-aef3-e630a09cd504  ethernet  ens224 
ens192      e9b24c38-a6f0-47cf-bebb-2649d5bbaaba  ethernet  ens192 

3.修改对应信息:

代码语言:javascript复制
[root@localhost network-scripts]# cat ifcfg-ens224 
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens224
UUID=e9fd0702-082b-3a3b-aef3-e630a09cd504
DEVICE=ens224
ONBOOT=yes
IPADDR=10.0.1.3
NETMASSK=255.255.255.0
GATEWAY=10.0.1.2
DNS1=114.114.114.114

4.激活配置和网卡

代码语言:javascript复制
[root@localhost network-scripts]# vi ifcfg-ens224 
[root@localhost network-scripts]# ifup ifcfg-ens224 
连接已成功激活(D-Bus 活动路径:/org/freedesktop/NetworkManager/ActiveConnection/13)
[root@localhost network-scripts]# ifup ens224 
[root@localhost network-scripts]# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:eb:d4:1d brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.130/24 brd 192.168.10.255 scope global noprefixroute ens192
       valid_lft forever preferred_lft forever
    inet6 fe80::eed:9ffd:246:fbf3/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:eb:d4:27 brd ff:ff:ff:ff:ff:ff
    inet 10.0.1.3/8 brd 10.255.255.255 scope global noprefixroute ens224
       valid_lft forever preferred_lft forever
    inet6 fe80::ef91:f8e:c05c:204/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

0 人点赞