在linux中,“ifcfg-eth0”是设置网络网卡接口参数的命令;ifcfg是用于设置网络接口参数的命令,eth0是网卡的接口名称,0表示接口的编号;可用该命令添加、删除或停止网卡接口,语法为“ifcfg-eth0 参数 ip地址”。
本教程操作环境:linux7.3系统、Dell G3电脑。
The curriculum operating environment: 7.3 systems, Dell G3 computers.
Linux中eth0往往是网卡的接口名称,0是阿拉伯数字零,表示接口的编号,因为可能有多个网卡;数字0前面的eth是Ethernet这个单词的简写(计算机技术领域大量使用单词的简写、缩写),Ethernet是以太网的意思,所以eth就表示这个网卡接口是一个以太网卡的接口。
In Linux, eth0 is often the name of the interface for the net card, 0 is the arabic zero, indicating the number of the interface, because there may be multiple webcards; in the front of digit 0, eth is the short word for the word Ethernet (absent use of short and abbreviated words in the field of computer technology) and Ethernet is meant to be too net, so that eth means that the webcard interface is an interface for the web card.
ifcfg命令是一个Bash脚本程序,用来设置linux中的网络接口参数。
The ifcfg command is a Bash script program that sets network interface parameters in linux.
语法格式:?
Syntax:?
ifcfg [device] [cmd] [address]
device就是网卡设备,它可能有别名。cmd可以是add、delete、stop。address就是ip地址。
The device is a net card. It may have an alias. Cmd can be an add, delete, stop. Address is an ip address.
示例如下:
Example:
停止指定网络接口上的IP地址:
Stop specifying an IP address on the network interface:
[root@linux265 ~]# ifcfg eth0 stop
为网络接口配置IP地址:
Configure IP addresses for network interfaces:
[root@linux265 ~]# ifcfg eth1 add 192.168.60.11/24
添加ip地址
Add an ip address
[root@localhost ~]# ifcfg eth0 add 192.168.0.250/24 //添加地址250 Forwarding is ON or its state is unknown (4). OK, No RDISC. [root@localhost ~]#ifconfig //查看网络信息 eth0 Link encap:Ethernet HWaddr 08:00:27:14:33:57 inet addr:192.168.0.250 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe14:3357/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:107276 errors:0 dropped:0 overruns:0 frame:0 TX packets:72250 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:83580745 (79.7 MiB) TX bytes:5842176 (5.5 MiB)
删除ip地址
Delete ip Address
[root@localhost ~]# ifcfg eth0 delete 192.168.0.250/24 //删除网卡地址 Forwarding is ON or its state is unknown (4). OK, No RDISC. [root@localhost ~]# ifconfig //查看网卡信息,ip地址已经删除 eth0 Link encap:Ethernet HWaddr 08:00:27:14:33:57 inet6 addr: fe80::a00:27ff:fe14:3357/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:107276 errors:0 dropped:0 overruns:0 frame:0 TX packets:72251 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:83580745 (79.7 MiB) TX bytes:5842218 (5.5 MiB)
推荐学习:Linux视频教程
Suggested studies: Linux Video Tutor
以上就是linux中ifcfg-eth0是什么的详细内容,更多请关注php中文网其它相关文章!
This is the details of what's in linufg-eth0, more attention to other relevant articles in php in Chinese!
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论