Welcome to my blog. This is anartice about the network card configuration of the centos .
欢迎来到我的博客。这是一篇关于centos网卡配置的文章。

Operations you must know

你必须知道的事情

How to check the network card name

如何查看网卡名

1
$ ip a

Open the centos network card path

打开centos网卡路径

1
$ /etc/sysconfig/network-scripts/ifcfg-xxx

Restart the network card

重启网卡

1
2
/etc/init.d/network resrtart
ifup xxx

Use vi or nano editor to edit network card configuration file

使用vi或

1
2
3
4
5
6
7
8
9
10
vi /etc/sysconfig/network-scripts/ifcfg-xxx
nano /etc/sysconfig/network-scripts/ifcfg-xxx
### vi
:wq #save
:q #exit
:wq! #force to wite
:q! #force to exit
### nano
ctrl + o #save
ctrl + x #exit

Format

1
2
3
4
5
6
7
8
9
10
BOOTPROTO=static
DEVICE=network card name
ONBOOT=yes
IPADDR=
NETMASK=
IPADDR2=
NETMASK2=
GATEWAY=
DNS1=8.8.8.8
DNS2=223.5.5.5

Thanks for reading. I don’t know if it was helpful.

More info: Deployment