天天看点

Centos7常用命令[网络]

Centos7常用命令[网络]

------------------------------------------------------------------------------

网络 - (以太网和WIFI无线):

# 显示一个以太网卡的配置

[root@localhost ~]# ifconfig eth0

# 启用一个eth0网络设备  

[root@localhost ~]# ifup eth0

# 禁用一个eth0网络设备 

[root@localhost ~]# ifdown eth0

# 控制IP地址

[root@localhost ~]# ifconfig eth0 192.168.1.1 netmask 255.255.255.0

# 设置eth0成混杂模式以嗅探数据包(sniffing)

[root@localhost ~]# ifconfig eth0 promisc

# 以dhcp模式启用eth0

[root@localhost ~]# dhclient eth0

继续阅读