且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Centos7常用命令[网络]

更新时间:2022-06-23 11:28:37

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