Linux学习笔记(八)网络命令
- 命令: ifconfig 检查活动网络适配器 $ ifconfig -a 检查活动网络适配器
$ ifconfig eth0 down 停用网络适配器 $ ifconfig eth0 up 启用网络适配器
为网络适配器eth0设定IP地址“192.168.1.12”. $ ifconfig eth0 192.168.1.12 更改网络适配器eth0的子网掩码 $ ifconfig eth0 netmask 255.255.255. 更改网络适配器eth0的广播地址 $ ifconfig eth0 broadcast 192.168.1.255 为网络适配器eth0指定IP地址,子网掩码,广播地址 $ ifconfig eth0 192.168.1.12 netmask 255.255.255.0 broadcast 192.168.1.255
2.命令: netstat 显示各种网络相关的信息 $ netstat -a 列出所有的网络端口 $ netstat -at 显示所有tcp相关端口 $ netstat -s 显示所有连接的统计信息