Linux系統新增自定義網路卡並更改網路卡介面
本文件詳細介紹給RHEL7新增一張自定義網路卡並更改網路卡介面的方法 |
環境
VMware Workstation Pro
Red Hat Enterprise
Server release 7.3
檢視當前網路卡資訊
[root@Jaking ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.3 (Maipo) [root@Jaking ~]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.10.11 netmask 255.255.255.0 broadcast 192.168.10.255 inet6 fe80::250:56ff:fe2b:88bf prefixlen 64 scopeid 0x20 ether 00:50:56:2b:88:bf txqueuelen 1000 (Ethernet) RX packets 454 bytes 44638 (43.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 339 bytes 33150 (32.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 112 bytes 9492 (9.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 112 bytes 9492 (9.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
新增網路卡
取消紅框內的鉤
檢視網路卡資訊
[root@Jaking ~]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.10.11 netmask 255.255.255.0 broadcast 192.168.10.255 inet6 fe80::250:56ff:fe2b:88bf prefixlen 64 scopeid 0x20 ether 00:50:56:2b:88:bf txqueuelen 1000 (Ethernet) RX packets 488 bytes 47935 (46.8 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 356 bytes 35698 (34.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ens38: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether 00:0c:29:46:f9:b8 txqueuelen 1000 (Ethernet) RX packets 5 bytes 594 (594.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 112 bytes 9492 (9.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 112 bytes 9492 (9.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
配置網路卡並更改網路卡介面
[root@Jaking ~]# cd /etc/sysconfig/network-scripts/ [root@Jaking network-scripts]# ls ifcfg-ens33 ifdown-ipv6 ifdown-TeamPort ifup-ippp ifup-routes network-functions ifcfg-lo ifdown-isdn ifdown-tunnel ifup-ipv6 ifup-sit network-functions-ipv6 ifdown ifdown-post ifup ifup-isdn ifup-Team ifdown-bnep ifdown-ppp ifup-aliases ifup-plip ifup-TeamPort ifdown-eth ifdown-routes ifup-bnep ifup-plusb ifup-tunnel ifdown-ib ifdown-sit ifup-eth ifup-post ifup-wireless ifdown-ippp ifdown-Team ifup-ib ifup-ppp init.ipv6-global
新增網路卡後,需要建立對應的網路卡配置檔案
[root@Jaking network-scripts]# cp ifcfg-ens33 ifcfg-ens34 [root@Jaking network-scripts]# vim ifcfg-ens34 TYPE=Ethernet BOOTPROTO=static DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no NAME=ens34 DEVICE=ens34 ONBOOT=yes IPADDR=172.16.100.100 NETMASK=255.255.255.0
禁用ens38介面
[root@Jaking network-scripts]# ip link set ens38 down [root@Jaking network-scripts]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.10.11 netmask 255.255.255.0 broadcast 192.168.10.255 inet6 fe80::250:56ff:fe2b:88bf prefixlen 64 scopeid 0x20 ether 00:50:56:2b:88:bf txqueuelen 1000 (Ethernet) RX packets 812 bytes 74791 (73.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 537 bytes 61780 (60.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 112 bytes 9492 (9.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 112 bytes 9492 (9.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
重新命名ens38介面為ens34
[root@Jaking network-scripts]# ip link set ens38 name ens34
啟用修改完成的ens34介面
[root@Jaking network-scripts]# ip link set ens34 up [root@Jaking network-scripts]# systemctl restart network [root@Jaking network-scripts]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.10.11 netmask 255.255.255.0 broadcast 192.168.10.255 inet6 fe80::250:56ff:fe2b:88bf prefixlen 64 scopeid 0x20 ether 00:50:56:2b:88:bf txqueuelen 1000 (Ethernet) RX packets 1389 bytes 123239 (120.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 913 bytes 117924 (115.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ens34: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.16.100.100 netmask 255.255.255.0 broadcast 192.168.100.255 ether 00:0c:29:46:f9:b8 txqueuelen 1000 (Ethernet) RX packets 5 bytes 594 (594.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2 bytes 120 (120.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 148 bytes 12552 (12.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 148 bytes 12552 (12.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
總結
以上就是給RHEL7新增一張自定義網路卡並更改網路卡介面的方法,希望能幫助到大家!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31524109/viewspace-2774340/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux系統自定義網路卡並更改網路卡介面Linux
- 更改Linux系統的網路卡名稱Linux
- linux更改網路卡的mac地址LinuxMac
- LINUX下手工新增網路卡Linux
- xp系統下怎樣更改網路卡實體地址
- 雲主機新增網路卡配置多網路卡策略路由路由
- centos 7.4 新增新網路卡CentOS
- Windows10系統新增虛擬網路卡的方法Windows
- Linux 網路卡配置Linux
- Linux網路卡teamLinux
- RAC中如何更改對外網路卡和內部網際網路卡的IP及VIP
- CentOS 6.X怎麼更改網路卡名稱?CentOS 6.X更改網路卡名稱的方法CentOS
- 麒麟系統修改網路卡名步驟和網路卡佔用故障處理
- rac更改public and private的網路卡和ip
- Linux網路卡繫結Linux
- linux 網路卡繫結Linux
- linux修改網路卡名字Linux
- LINUX網路卡檢查Linux
- Centos(RHEL) 6 新增網路卡的方法CentOS
- Xen虛擬機器新增網路卡虛擬機
- Win10怎麼禁用網路卡 win10系統禁用網路卡的方法Win10
- Linux下檢視網路卡資訊及確定網路卡位置Linux
- Linux系統下雙網路卡bonding的配置方法Linux
- Linux 2.1 AS 下安裝ISA介面的UNPNP網路卡Linux
- Linux單網路卡繫結多IP與多網路卡共用單IPLinux
- Mac Linux 重啟網路卡MacLinux
- Linux(09):網路卡繫結Linux
- Linux Ubuntu 修改網路卡名字LinuxUbuntu
- Linux修改網路卡的名字Linux
- Linux 7 配置網路卡(nmcli)Linux
- linux雙網路卡繫結Linux
- Linux雙網路卡聚合改造Linux
- Linux 繫結雙網路卡Linux
- Linux檢視網路卡流量Linux
- Linux 雙網路卡繫結Linux
- Linux物理網路卡bondingLinux
- Linux命令----分析網路卡流量Linux
- linux rac 網路卡繫結Linux