首页 > 编程知识 正文

centos7激活网卡,centos启用网卡

时间:2023-05-05 07:17:34 阅读:150895 作者:4140

关键词http://www.Sina.com/http://www.Sina.com/http://www.Sina.com/3358 www.Sina.com/Lina/com sys config/network-scripts/ifcfg-*-eth 0、ifcfg-eth1、ifcfg-eth2(如果有多个网卡名称)或其他名称的if CFG

系统通电后,将加载此配置文件,并放置网络信息,如IP地址

redhat系列网络相关配置文件/etc/sys config/network-scripts/if CFG-eth0#网卡、网关、DNS等/etc/resolv.config/if CFG-eth0# type=以太网# NIC类型device=eth0#NIC接口名称ONBOOT=yes #说明系统启动时是否自动加载。 删除此项可启用已通电的NIC的自启动BOOTPROTO=none #地址协议和dhcp动态IP分配。 对于静态IP分配,none不使用引导协议,IPADDR=192.168.1.11 #IP地址NETMASK=255.255.255.0 #子网掩码gateway=192.168 网关地址DNS1=10.203.1003网卡DNS地址2 hwaddr=00:0 c 3360293360133605 d :74 #网卡设备MAC地址broadcast=1990 网卡地址启动和停止管理网卡所有网络接口===============================root @ 192 _ 168 _ 31 如果配置错误,SSH连接可能会断开,从而导致管理单个网络接口=================关闭ifdown eth0# eth 0接口的ifup eth0# 0 显示信息IPaddrshash缩写显示netstat -r #路由表显示route #路由表生产配置示例1(qemu虚拟机) [ root @ 192 _ 168 _ 31 _ 106 ] # cacat # 106 () ) cat/etc/sysconfi if CFG-eth0type=' Ethernet ' proxy _ method=' none ' browser _ only=' no ' boot proto=' none ' def route=' gen _ mode=' stable-privacy ' name=' eth0' uuiii ' IP addr=192.168.31.106 net mask=255.255.255.255.0 gateway=network-scripts/if CFG-eth0# createdbycloud-initoninstancebootautomatically,dono tedit.# if you don ' twantcloud-inted youcandisableitin/etc/cloud/cloud.CFG # formoreinforrre pleasereferto :https://help.a liyun.com/document _ detail boot proto=DHCP device=eth0on boot=yes start mode=autotype=ethernetuserctl=no生产环境配置实例3 (物理机(# cat/etc/sys conff nete TTC if CFG-et h1 device=eth0on boot=yes hwaddr=7833608 b :2033602 b 336036 type=Ethernet boot proto=none IP addr=article/details/48276323https://access.red hat.com/documentation/en-us/red _ () )。 S1-network scripts-interfaces 3359 www.thegeekdiary.com/understanding-the-network-interface-configuration-figuration

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。