ifconfig命令
eth0 Link encap:Ethernet HWaddr 00:30:67:F2:10:CF
inet addr:10.0.0.253 Bcast:10.0.255.255 Mask:255.255.0.0
inet6 addr: fe80::230:67ff:fef2:10cf/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4663517 errors:0 dropped:0 overruns:0 frame:0
TX packets:6122850 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1852734274 (1.7 GiB) TX bytes:1487018040 (1.3 GiB)
HWaddr :网卡的硬件地址,即MAC地址
inet addr:IPv4的IP 地址
Bcast:广播地址
mask:子网掩码
inet6 addr:IPv6地址
MTU:最大传输单元
Metric:用于计算路由的成本
RX:表示网络启动到现在的封包接受情况 (Receive)
packets:表示接包数
errors:表示接包发生错误的数量
dropped:表示丢弃的包数量
overruns:表示接收时因过速而丢失的数据包数
frame:表示发生frame错误而丢失的数据包数
TX:从网络启动到现在传送的情况 (Transmit)
collisions:冲突信息包的数目
txqueuelen:发送队列的大小
RX byte、TX byte:总传送/接受的量
注:由RX和TX可以了解网络是否非常繁忙
注:errors:0 dropped:0 overruns:0 frame:0,都为0 说明网络比较稳定
注:collisions发生太多次表示网络状况不太好
ip命令
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:00:d6:81:26 brd ff:ff:ff:ff:ff:ff
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:00:d6:81:26 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
107193541 1118624 0 0 0 0
TX: bytes packets errors dropped carrier collsns
116799818 1093559 0 0 0 0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:00:d6:81:26 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
107031087 1116940 0 0 0 0
RX errors: length crc frame fifo missed
0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
116526036 1091941 0 0 0 0
TX errors: aborted fifo window heartbeat
0 0 0 0
10.0.0.0/16 dev eth0 proto kernel scope link src 10.0.10.158
169.254.0.0/16 dev eth0 scope link metric 1002
default via 10.0.0.254 dev eth0
[NEIGH]10.104.64.1 dev eth0 lladdr fe:ee:ff:ff:ff:ff STALE
[NEIGH]10.104.64.1 dev eth0 lladdr fe:ee:ff:ff:ff:ff REACHABLE
[NEIGH]10.104.64.1 dev eth0 lladdr fe:ee:ff:ff:ff:ff STALE
[NEIGH]10.104.64.1 dev eth0 lladdr fe:ee:ff:ff:ff:ff REACHABLE
[NEIGH]10.104.64.1 dev eth0 lladdr fe:ee:ff:ff:ff:ff STALE
[NEIGH]10.104.64.1 dev eth0 lladdr fe:ee:ff:ff:ff:ff REACHABLE
10.104.64.1 dev eth0 lladdr fe:ee:ff:ff:ff:ff REACHABLE
route命令
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.104.64.0 0.0.0.0 255.255.192.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
0.0.0.0 10.104.64.1 0.0.0.0 UG 0 0 0 eth0
Destination:目的地
Genmask:路由的网络掩码
Gateway:该网络通过哪个网关连接出去的(下一跳)
0.0.0.0:表示路由直接由本机传送,即局域网的MAC直接发送的
IP:表示该路由需要路由器(网关)的转发才能发送
Flags:标志
U Up表示此路由当前为启动状态
H Host,表示此网关为一主机
G Gateway,表示此网关为一路由器
R Reinstate Route,使用动态路由重新初始化的路由
D Dynamically,此路由是动态性地写入
M Modified,此路由是由路由守护程序或导向器动态修改
! 表示此路由当前为关闭状态
Iface:这个路由传递数据包的接口
2.增删/设置路由