Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add a custom network card and change its interface in RHEL7

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to add a custom network card and change the interface of the network card in RHEL7. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Environment

VMware Workstation Pro Red Hat Enterprise Linux Server release 7.3

View current network card information [root@Jaking ~] # cat / etc/redhat-releaseRed Hat Enterprise Linux Server release 7.3 (Maipo) [root@Jaking ~] # ifconfigens33: flags=4163 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 454bytes 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 0lo: flags=73 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 bytes 9492 (9.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 add network card to cancel the hook in the red box to view the network card information [root@Jaking ~] # ifconfigens33: flags=4163 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 0ens38: flags=4163 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.0B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73 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 configure the network card and change the network card Interface [root@Jaking ~] # cd / etc/sysconfig/network-scripts/ [root@Jaking network-scripts] # lsifcfg-ens33 ifdown-ipv6 ifdown-TeamPort ifup-ippp ifup-routes network-functionsifcfg-lo ifdown-isdn ifdown-tunnel ifup-ipv6 ifup-sit network-functions-ipv6ifdown ifdown-post ifup ifup-isdn ifup-Teamifdown-bnep ifdown-ppp ifup-aliases ifup-plip ifup-TeamPortifdown- After the network card is added to eth ifdown-routes ifup-bnep ifup-plusb ifup-tunnelifdown-ib ifdown-sit ifup-eth ifup-post ifup-wirelessifdown-ippp ifdown-Team ifup-ib ifup-ppp init.ipv6-global Need to create a corresponding network card configuration file [root@Jaking network-scripts] # cp ifcfg-ens33 ifcfg-ens34 [root@Jaking network-scripts] # vim ifcfg-ens34 TYPE=EthernetBOOTPROTO=staticDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noNAME=ens34DEVICE=ens34ONBOOT=yesIPADDR=172.16.100.100NETMASK=255.255.255.0 disable ens38 interface [root@Jaking network-scripts] # ip link set ens38 down [root@Jaking network-scripts] # ifconfigens33: flags=4163 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 0lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 Inet6:: 1 prefixlen 128scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 1122bytes 9492 (9.2KiB) RX errors 0 dropped 0 overruns 0 frame 0TX packets 112bytes 9492 (9.2KiB) TX errors 0dropped 0overruns 0carrier 0collisions 0 rename ens38 interface to ens34 [root@Jaking network-scripts] # ip link set ens38 name ens34 enable modified ens34 interface [root@Jaking network-scripts] # ip link Set ens34 up [root@Jaking network-scripts] # systemctl restart network [root@Jaking network-scripts] # ifconfig ens33: flags=4163 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 0ens34: flags=4163 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 0lo: flags=73 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 148bytes 12552 (12.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets bytes 12552 (12.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Thank you for reading! This is the end of the article on "how to add a custom network card and change the interface of the network card in RHEL7". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report