常用的linux 网络命令

最新文章:Virson's Blog

文章来自笨兔兔:http://www.bentutu.com/2011/12/usually-used-linux-network-cmds.html/

适用于Debian 系Linux 发行版本

ifconfig – 显示网络信息,包括IP地址、数据包接收/发送情况
iwconfig – 显示无线网络信息
sudo /etc/init.d/networking restart – 重启网络
/etc/network/interfaces – 手动配置网络文件
ifup interface – 启用网络接口
ifdown interface – 禁用网络接口

iwlist scan- 显示区域内无线网络情况
lshw -C network – 显示网卡和网络设备驱动信息(需以管理员权限运行)

lspci -nn – Shows PCI vendor and device codes as both numbers and names of hardware connected to the pci bus
lsusb – Shows USB connected hardware
lshw -C usb – Additional info on USB related hardware (good for USB dongles)

route -n – 列举内核 IP 路由表,可用网关来解决相关问题
sudo dhclient – 从DHCP 服务器上获取IP地址
sudo dhclient -r – 从指定的网络接口获取IP 地址
/etc/udev/rules.d/70-persistent-net.rules – (File) 主管映射logical names (eth0, wlan0, etc) 到 MAC 地址
cat /etc/resolv.conf – 查看DNS 服务器

原文地址:https://www.cnblogs.com/mawanglin2008/p/2278442.html