Linux 配置网卡

①  打开 linux  输入    ifconfig             : 显示网段信息

Linux 配置网卡

 ② 输入    vim /etc/sysconfig/network-scripts/ifcfg-eth0       添加 配置信息 (新配好的是没有这些信息的) 

Linux 配置网卡

信息 如下:

DEVICE=eth0

HWADDR=00:0C:29:30:FB:A6

TYPE=Ethernet

UUID=d67af3d4-3b44-44ce-a8ca-cbc558edf263

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

HWADDR=00:0C:29:30:FB:A6

DEROUTE=yes

PEERDNS=yes

REERROUTES=yes

IPV4_FAILURE_FATAL=yes

IPV6INIT=no

NAME="System eth0"

IPADDR=192.168.100.10

NETMASK=255.255.255.0

GATEWAY=192.168.100.2

DNS1=8.8.8.8

USERCTL=no

③ 查看自己的电脑 网段配置   是否与 linux  一致    

Linux 配置网卡 Linux 配置网卡

④    vim /etc/udev/rules.d/70-persistent-net.rules      配置 mac  等等信息 

 

Linux 配置网卡 

⑤ window  加  r   按出 运行     然后 输入 cmd  (输入 ipconfig ) 查看网段 是否 对应  linux 

Linux 配置网卡

Linux 配置网卡

 

⑥  重启  linux  服务

 

Linux 配置网卡

 

⑦  linux  输入命令     ping 192.168.65.57     出现如下 信息 代表 连接 windows 主机成功 

Linux 配置网卡

 

⑧ linux  输入命令     ping  www.baidu.com     出现如下 信息 代表 配置 网络 成功 

Linux 配置网卡