centos6.9-minimal-64bits + NAT + dhcp的网卡配置
发布日期:2021-06-30 22:17:28 浏览次数:2 分类:技术文章

本文共 1782 字,大约阅读时间需要 5 分钟。

前言

刚手动在vmware14中装完centos6.9-minimal-64bits, ifconfig是没IP的.

将/etc/sysconfig/network-scripts/ifcfg-eth0中的ONBOOT由no改为yes, 增加DNS服务器,重启网卡服务,IP就有了。

实验

刚装完centos6.9-minimal-64bits, /etc/udev/rules.d/70-persistent-net.rules 文件不用改, 就一块网卡cd /etc/sysconfig/network-scriptsmkdir ./bkcp ./ifcfg-eth0 ./bkvi ./ifcfg-eth0#--------------------------------------------------------------------------------# @file /etc/sysconfig/network-scripts/ifcfg-eth0#--------------------------------------------------------------------------------DEVICE=eth0TYPE=EthernetUUID=ed4384a7-1ab2-4720-bb0b-9fe15d6289f3# change no to yesONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=dhcpHWADDR=00:0C:29:D7:31:51DEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=yesIPV6INIT=noNAME="System eth0"# add dns serverDNS1=8.8.8.8DNS2=8.8.4.4#--------------------------------------------------------------------------------service network restart[root@localhost ~]# ifconfigeth0      Link encap:Ethernet  HWaddr 00:0C:29:D7:31:51            inet addr:192.168.180.136  Bcast:192.168.180.255  Mask:255.255.255.0          inet6 addr: fe80::20c:29ff:fed7:3151/64 Scope:Link          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:110 errors:0 dropped:0 overruns:0 frame:0          TX packets:65 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000           RX bytes:10767 (10.5 KiB)  TX bytes:8445 (8.2 KiB)lo        Link encap:Local Loopback            inet addr:127.0.0.1  Mask:255.0.0.0          inet6 addr: ::1/128 Scope:Host          UP LOOPBACK RUNNING  MTU:65536  Metric:1          RX packets:0 errors:0 dropped:0 overruns:0 frame:0          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:0           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

转载地址:https://lostspeed.blog.csdn.net/article/details/79906113 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:LFS : 制作分区和挂载分区
下一篇:禁止vmware的简易安装

发表评论

最新留言

表示我来过!
[***.240.166.169]2024年04月29日 17时58分08秒