RHEL7中如何添加自定义网卡并更改网卡接口
发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,这篇文章给大家分享的是有关RHEL7中如何添加自定义网卡并更改网卡接口的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。环境VMware Workstation Pro Red
千家信息网最后更新 2026年11月01日RHEL7中如何添加自定义网卡并更改网卡接口
这篇文章给大家分享的是有关RHEL7中如何添加自定义网卡并更改网卡接口的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
环境
VMware Workstation Pro Red Hat Enterprise Linux Server release 7.3
查看当前网卡信息
[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 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 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
添加网卡
取消红框内的钩
查看网卡信息
[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.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 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]# 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-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
添加网卡后,需要创建对应的网卡配置文件
[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
禁用ens38接口
[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 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 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 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中如何添加自定义网卡并更改网卡接口"这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
网卡
接口
信息
内容
更多
篇文章
配置
不错
实用
文件
文章
环境
看吧
知识
参考
帮助
有关
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
南京欣网互联网络科技有限公司
广州百单互联网科技有限公司
重生之互联网科技帝国
今日互联网科技
互联网电商科技
互联网通讯科技
互联网络科技有限公司
互联网 科技创业
成都互联网科技公司
互联网高科技企业
人人互联网科技是培训
深圳卡尔迅互联网科技有限公司怎么样
安控科技rtu产品工业互联网
顶级互联网科技成果有哪些
晋城互联网科技
为客找房互联网科技公司怎么样
美国互联网科技公司
浙南科技城互联网大厦招聘
互联网科技股为什么大涨
西安有哪些互联网高科技企业
互联网金融科技
有格互联网科技
蓝思科技飞鸽互联网
互联网为科技
互联网金融 金融科技
凡科互联网科技
米聚互联网科技南京有限公司排面
互联网科技和法律行业
伊宁互联网科技做什么的
青岛互联网科技园