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下手工新增網路卡Linux
- 雲主機新增網路卡配置多網路卡策略路由路由
- centos 7.4 新增新網路卡CentOS
- Windows10系統新增虛擬網路卡的方法Windows
- linux系統使用shell命令過濾物理網路卡Linux
- linux 網路卡繫結Linux
- Linux網路卡繫結Linux
- CentOS 6.X怎麼更改網路卡名稱?CentOS 6.X更改網路卡名稱的方法CentOS
- 麒麟系統修改網路卡名步驟和網路卡佔用故障處理
- Mac Linux 重啟網路卡MacLinux
- Linux 7 配置網路卡(nmcli)Linux
- Linux Ubuntu 修改網路卡名字LinuxUbuntu
- Linux(09):網路卡繫結Linux
- Linux修改網路卡的名字Linux
- linux檢視網路卡型號Linux
- rocky linux 重啟網路卡命令Linux
- Linux 雙網路卡雙IP配置Linux
- Linux系統如何檢視網路卡的資訊及數量?Linux
- KVM虛擬機器新增物理網路卡虛擬機
- 千兆網路卡與萬兆網路卡的區別在哪?
- Linux 虛擬網路卡技術:MacvlanLinuxMac
- Linux虛擬網路卡TUN和TAPLinux
- linux網路卡配置檔案詳解Linux
- linux下打滿網路卡的頻寬和影響打滿網路卡的原因Linux
- VMwareNAT網路卡配置
- 更改 RHEL7 或者 CentOS 7 的網路卡名稱CentOS
- windows10系統如何回退網路卡驅動Windows
- NB物聯網路卡與物聯網路卡的區別
- Linux 中如何啟用和禁用網路卡?Linux
- 檢視Linux網路卡UUID和MAC地址---Linux命令LinuxUIMac
- 什麼是智慧網路卡?智慧網路卡的作用是什麼?
- 三大運營商網際網路卡套餐大全 網際網路卡套餐有哪些
- 合理設定作業系統網路卡的MTU值作業系統
- 想做物聯網路卡系統 是因為不想忍
- 深度分析Linux下雙網路卡繫結七種模式 多網路卡的7種bond模式原理Linux模式
- 網路卡-國家碼