赞
踩
ifconfig [网络设备] [参数]
[root@localhost ~] # ifconfig eth0 down // 关闭网卡[root@localhost ~] # ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE // 修改 MAC 地址[root@localhost ~] # ifconfig eth0 up // 启动网卡[root@localhost ~] # ifconfigeth0 Link encap:Ethernet HWaddr 00:AA:BB:CC:DD:EEinet addr:192.168.120.204 Bcast:192.168.120.255 Mask:255.255.255.0UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:8700857 errors:0 dropped:0 overruns:0 frame:0TX packets:31533 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:596390239 (568.7 MiB) TX bytes:2886956 (2.7 MiB)lo Link encap:Local Loopbackinet addr:127.0.0.1 Mask:255.0.0.0UP LOOPBACK RUNNING MTU:16436 Metric:1RX packets:68 errors:0 dropped:0 overruns:0 frame:0TX packets:68 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:2856 (2.7 KiB) TX bytes:2856 (2.7 KiB)
1.[root@localhost ~] # ifconfig eth0 192.168.120.562.[root@localhost ~] # ifconfig eth0 192.168.120.56 netmask 255.255.255.03.[root@localhost ~] # ifconfig eth0 192.168.120.56 netmask 255.255.255.0 broadcast 192.168.120.255
ifconfig eth0 192.168.120.56 给 eth0 网卡配置 IP 地:192.168.120.56ifconfig eth0 192.168.120.56 netmask 255.255.255.0 给 eth0 网卡配置 IP 地址:192.168.120.56 ,并加上子掩码:255.255.255.0ifconfig eth0 192.168.120.56 netmask 255.255.255.0 broadcast 192.168.120.255/给 eth0 网卡配置 IP 地址:192.168.120.56,加上子掩码:255.255.255.0,加上个广播地址:192.168.120.255
ip addr
ip addr add [ip 地址]/子网掩码位 dev [网卡]
删除 ip 地址
ip addr del [ip 地址]/子网掩码位 dev [网卡]
ip route show
说明:
ip 命令的路由对象的参数还可以帮助你查看网络中的路由数据,并设置你的路由表。第一个条目是默认的路由条目,你可以随意改动它。在上面这个例子中,这个结果显示有几个设备通过不同的网络接口连接起来。它们包括 WIFI、以太网和一个点对点连接。
ip route get [ip 地址]
ip route add default via [路由地址]
ip -s link
ip neighbour 或 ip neigh
监控 netlink 消息
ip monitor all
[root@Gin scripts] # ip monitor all[NEIGH]192.168.17.2 dev eth0 lladdr 00:50:56:f3:2d:50REACHABLE[NEIGH]192.168.17.1 dev eth0 lladdr 00:50:56:c0:00:08REACHABLE
$ ip link set eth0 down // 停止 eth0$ ip link set eth0 up // 启动 eth0
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。