首先看下有多少个网卡:

  1. enp1s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
  2. inet 120.132.118.194 netmask 255.255.255.224 broadcast 120.132.118.223
  3. inet6 fe80::ee4d:5fb1:687a:78bf prefixlen 64 scopeid 0x20<link>
  4. ether 00:26:6c:f0:25:f8 txqueuelen 1000 (Ethernet)
  5. RX packets 80277206 bytes 33422737362 (31.1 GiB)
  6. RX errors 0 dropped 155 overruns 0 frame 0
  7. TX packets 60159271 bytes 66876332578 (62.2 GiB)
  8. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
  9. device memory 0xfbde0000-fbdfffff
  10. enp1s0f1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
  11. ether 00:26:6c:f0:25:f9 txqueuelen 1000 (Ethernet)
  12. RX packets 0 bytes 0 (0.0 B)
  13. RX errors 0 dropped 0 overruns 0 frame 0
  14. TX packets 0 bytes 0 (0.0 B)
  15. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
  16. device memory 0xfbd60000-fbd7ffff
  17. lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
  18. inet 127.0.0.1 netmask 255.0.0.0
  19. inet6 ::1 prefixlen 128 scopeid 0x10<host>
  20. loop txqueuelen 1000 (Local Loopback)
  21. RX packets 3901 bytes 398851 (389.5 KiB)
  22. RX errors 0 dropped 0 overruns 0 frame 0
  23. TX packets 3901 bytes 398851 (389.5 KiB)
  24. TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

然后配置第二张网卡:

  1. cp /etc/sysconfig/network-scripts/ifcfg-enp1s0f0 /etc/sysconfig/network-scripts/ifcfg-enp1s0f1

再把enp1s0f1的网卡改成新分配的ip地址:

  1. TYPE=Ethernet
  2. BOOTPROTO=none
  3. DEFROUTE=yes
  4. PEERDNS=yes
  5. PEERROUTES=yes
  6. IPV4_FAILURE_FATAL=no
  7. IPV6INIT=yes
  8. IPV6_AUTOCONF=yes
  9. IPV6_DEFROUTE=yes
  10. IPV6_PEERDNS=yes
  11. IPV6_PEERROUTES=yes
  12. IPV6_FAILURE_FATAL=no
  13. IPV6_ADDR_GEN_MODE=stable-privacy
  14. NAME=enp1s0f0
  15. UUID=a2649544-aaa-aaa-81c6-b0bc0520bc2e
  16. DEVICE=enp1s0f0
  17. ONBOOT=yes
  18. IPADDR=1.2.13.198 #这个要改下,就可以了。
  19. PREFIX=27

然后重启你的网卡

  1. service network restart

分类: web

标签:   linux