addethmcastrule
A. linux下如何设置策略路由,给举个例子说明一下哦
1、查看本机路由信息
[root@Router ~]# ip route ls
192.168.70.0/24 dev eth0 proto kernel scope link src 192.168.70.70
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.70
169.254.0.0/16 dev eth1 scope link
default via 192.168.1.1 dev eth0
2、确认是否需要改变默认路由
[root@Router ~]# ip route replace default via 192.168.70.254 dev eth0 table main
[root@Router ~]# ip route ls
192.168.70.0/24 dev eth0 proto kernel scope link src 192.168.70.70
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.70
169.254.0.0/16 dev eth1 scope link
default via 192.168.1.1 dev eth0
3、建立特殊路由表
[root@Router ~]# vi /etc/iproute2/rt_tables
255 local
254 main
253 default
200 test
4、向test路由表中添加它自己的默认路由
[root@Router ~]# ip route add default via 192.168.1.1 table test
注意:这个table test一定不要忘了写,否则写到了主路由表中
5、先看看机器当前的ip rule
[root@Router ~]# ip rule ls
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
可以看到,规则中走了3个路由表,local、main、default
我们平常用route看到的,实际是路由表main
这些规则是按序号大小顺序走的,一个不同,则走下一个,知道通路或走完为止
6、添加路由到路由表test中
[root@Router ~]# ip rule add to 59.76.0.0/16 pref 10000 table test
这个意思是说,去向IP地址范围为59.76.0.0/16的访问,则启用test的路由表中的路由规则
而test的路由规则是什么呢?上面已经设置了,走的是202.196.x.1的路由.
现在再来看一下当前的ip rule
[root@Router ~]# ip rule ls
0: from all lookup local
10000: from all to 59.76.0.0/16 lookup test
32766: from all lookup main
32767: from all lookup default
B. 2020年ETH升级2.0超级版本,会带来什么影响
原因:
Linux distribution使用udev动态管理设备文件,并根据设备的信息对其进行持久化命名。udev会在系统引导的过程中识别网卡,将mac地址和网卡名称对应起来记录在udev的规则脚本中。而对于新的虚拟机,VMware会自动为虚拟机的网卡生成MAC地址,当克隆或者重装虚拟机软件时,由于使用的是以前系统虚拟硬盘的信息,而该系统中已经有eth0的信息,对于这个新的网卡,udev会自动将其命名为eth1(累加的原则),所以在系统启动后,使用ifconfig看到的网卡名为eth1。
解决方法:
在fedora中,udev记录网络规则的脚本为:/etc/udev/rules.d/70-persistent-net.rules
[user@localhost ~]$ vi /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:5a:6c:73", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:a9:22:9d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
打开该文件,这时会发现,里面有eth0,eth1两个网卡的信息,但实际上ifconfig时只能发现eth1一个网卡的信息,这时因为eth0根本就不存在。
将其中eth0的信息删掉,并将eth1信息中的设备名改为eth0,重启系统,看到的网卡就是eth0了,或者删掉其中所有的信息重启系统udev会帮发现新的设备的。
C. 怎么阻止centos7主动访问外网
1. IP 封禁 (这个是我们平时用得最多的)
# firewall-cmd --permanent --add-rich-rule="rule family='ipv4' source address='222.222.222.222' reject" 单个IP
# firewall-cmd --permanent --add-rich-rule="rule family='ipv4' source address='222.222.222.0/24' reject" IP段
# firewall-cmd --permanent --add-rich-rule="rule family=ipv4 source address=192.168.1.2 port port=80 protocol=tcp accept" 单个IP的某个端口
这个是我们用得最多的。封一个IP,和一个端口 reject 拒绝 accept 允许
当然,我们仍然可以通过 ipset 来封禁 ip
# firewall-cmd --permanent --zone=public --new-ipset=blacklist --type=hash:ip
# firewall-cmd --permanent --zone=public --ipset=blacklist --add-entry=222.222.222.222
封禁网段
# firewall-cmd --permanent --zone=public --new-ipset=blacklist --type=hash:net
# firewall-cmd --permanent --zone=public --ipset=blacklist --add-entry=222.222.222.0/24
倒入 ipset 规则
# firewall-cmd --permanent --zone=public --new-ipset-from-file=/path/blacklist.xml
然后封禁 blacklist
# firewall-cmd --permanent --zone=public --add-rich-rule='rule source ipset=blacklist drop'
2、IP封禁和端口
# firewall-cmd --permanent --add-rich-rule="rule family=ipv4 source address=192.168.1.2 port port=80 protocol=tcp accept"
只对192.168.1.2这个IP只能允许80端口访问 (拒绝访问只需把 accept 换成 reject、删除该规则把 –add-rich-rule 改成 –remove-rich-rule即可)
# firewall-cmd --permanent --add-rich-rule="rule family=ipv4 source address=192.168.1.2/24 port port=80 protocol=tcp accept"
只对192.168.1.2这个IP段只能允许80端口访问(拒绝访问只需把 accept 换成 reject、删除该规则把 –add-rich-rule 改成 –remove-rich-rule即可)
3、双网卡内网网卡不受防火墙限制
# firewall-cmd --permanent --zone=public --add-interface=eth1
公网网卡–zone=public默认区域
# firewall-cmd --permanent --zone=trusted --add-interface=eth2
内网网卡–zone=trusted是受信任区域 可接受所有的网络连接
重新载入以生效
# firewall-cmd --reload
D. 关于linux系统下双网卡同时访问内外网的问题
ifconfig -a 我看看你的子网掩码对不对!一般要把如果不想跨网段访问,就得设好子网掩码!
应该两个网段的掩码都设成 255.255.255.0
E. Linux的网卡由eth0变成了eth1,怎么修复
在fedora中,udev记录网络规则的脚本为:/etc/udev/rules.d/70-persistent-net.rules
[user@localhost ~]$ vi /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:5a:6c:73", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:a9:22:9d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
打开该文件,这时你会发现,里面有eth0,eth1两个网卡的信息,但实际上你ifconfig时只能发现eth1一个网卡的信息,这时因为eth0根本就不存在。
将其中eth0的信息删掉,并将eth1信息中的设备名改为eth0,重启系统,你看到的网卡就是eth0了,或者删掉其中所有的信息重启系统udev会帮你发现新的设备的。
另外还有一个启动脚本文件/etc/sysconfig/network-scripts/ifcfg-eth0,该文件中的mac地址为原来eth0网卡的物理地址,而虚拟机为eth1分配新的物理地址,故启动脚本中的信息与实际信息时不匹配的,将MAC的地址信息修改为70-persistent-net.rules中的eth1的MAC地址,再次重启网络,就完全恢复到以前eth0网卡的状态了。
F. H3C防火墙配置,把某不能上网的网段改成能上网
sys
local-user admin service telnet
acl num 2000 //新增
rule per source 192.168.3.0 0.0.0.255 //新增
quit //新增
interface eth 0/0/1
ip add 192.168.3.1 24
quit
interface eth 0/0/0
ip add 192.168.2.254 24 //新增
nat out 2000
quit
firewall zone trust
add interface eth0/0/1
quit
firewall zone untrust
add interface eth 0/0/0
quit
firewall packet-filter default permit all
ip rout 0.0.0.0 0.0.0.0 192.168.2.1
user-interface vty 0 4
authentication-mode password
set authentication password simple admin
quit
//新增 的这几条写上就可以了。
G. ubuntu server13.10更改网卡名称
终端输入:vi /etc/udev/rules.d/70-persistent-net.rules
出现以下文件
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x10de (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:65:b5:82:ca", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0d:0c:69:af:b8", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0e:01:2c:09:9c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
修改相对的设备名称,保存退出,重启网卡服务
H. eth0变成了rename2,怎么回事
原因:
Linux distribution使用udev动态管理设备文件,并根据设备的信息对其进行持久化命名。udev会在系统引导的过程中识别网卡,将mac地址和网卡名称对应起来记录在udev的规则脚本中。而对于新的虚拟机,VMware会自动为虚拟机的网卡生成MAC地址,当克隆或者重装虚拟机软件时,由于使用的是以前系统虚拟硬盘的信息,而该系统中已经有eth0的信息,对于这个新的网卡,udev会自动将其命名为eth1(累加的原则),所以在系统启动后,使用ifconfig看到的网卡名为eth1。
解决方法:
在fedora中,udev记录网络规则的脚本为:/etc/udev/rules.d/70-persistent-net.rules
[user@localhost ~]$ vi /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:5a:6c:73", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:a9:22:9d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
打开该文件,这时会发现,里面有eth0,eth1两个网卡的信息,但实际上ifconfig时只能发现eth1一个网卡的信息,这时因为eth0根本就不存在。
将其中eth0的信息删掉,并将eth1信息中的设备名改为eth0,重启系统,看到的网卡就是eth0了,或者删掉其中所有的信息重启系统udev会帮发现新的设备的。
I. linux 中设置IP,子网掩码,网关,DNS的命令是什么
用root用户身份
命令是 ifconfig
但是要修改这些配置,一般要修改 /etc/sysconfig/networking下的配置文件
配置网卡一般修改 ifcfg-eth0这个文件
#ifconfig eth0 172.16.1.28/24
具体的可以用 # man ifconfig 来查看用法
J. linux下配置网络连接
linux 命令配置网络连接首先,先了解传统的网络设置命令:
1. 使用ifconfig命令设置并查看网络接口情况
示例1: 设置eth0的IP,同时激活设备:
# ifconfig eth0 192.168.4.1 netmask 255.255.255.0 up
示例2: 设置eth0别名设备 eth0:1 的IP,并添加路由
# ifconfig eth0:1 192.168.4.2
# route add ?host 192.168.4.2 dev eth0:1
示例3:激活(禁用)设备
# ifconfig eth0:1 up(down)
示例4:查看所有(指定)网络接口设置
# ifconfig (eth0)
2. 使用route 命令设置路由表
示例1:添加到主机路由
# route add ?host 192.168.4.2 dev eth0:1
# route add ?host 192.168.4.1 gw 192.168.4.250
示例2:添加到网络的路由
# route add ?net IP netmask MASK eth0
# route add ?net IP netmask MASK gw IP
# route add ?net IP/24 eth1
示例3:添加默认网关
# route add default gw IP
示例4:删除路由
# route del ?host 192.168.4.1 dev eth0:1
示例5:查看路由信息
# route 或 route -n (-n 表示不解析名字,列出速度会比route 快)
3.ARP 管理命令
示例1:查看ARP缓存
# arp
示例2: 添加
# arp ?s IP MAC
示例3: 删除
# arp ?d IP
4. ip是iproute2软件包里面的一个强大的网络设置工具,他能够替代一些传统的网络管理工具。例如:ifconfig、route等,
上面的示例完万能用下面的ip命令实现,而且ip命令能实现更多的功能.下面介绍一些示例:
4.0 ip命令的语法
ip命令的用法如下:
ip [OPTIONS] OBJECT [COMMAND [ARGUMENTS]]
4.1 ip link set--改动设备的属性. 缩写:set、s
示例1:up/down 起动/关闭设备。
# ip link set dev eth0 up
这个等于传统的 # ifconfig eth0 up(down)
示例2:改动设备传输队列的长度。
参数:txqueuelen NUMBER或txqlen NUMBER
# ip link set dev eth0 txqueuelen 100
示例3:改动网络设备MTU(最大传输单元)的值。
# ip link set dev eth0 mtu 1500
示例4: 修改网络设备的MAC地址。
参数: address LLADDRESS
# ip link set dev eth0 address 00:01:4f:00:15:f1
4.2 ip link show--显示设备属性. 缩写:show、list、lst、sh、ls、l
-s选项出现两次或更多次,ip会输出更为周详的错误信息统计。
示例:
# ip -s -s link ls eth0
eth0: mtu 1500 qdisc cbq qlen 100
link/ether 00:a0:cc:66:18:78 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
2449949362 2786187 0 0 0 0
RX errors: length crc frame fifo missed
0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
178558497 1783946 332 0 332 35172
TX errors: aborted fifo window heartbeat
0 0 0 332
这个命令等于传统的 ifconfig eth0
5.1 ip address add--添加一个新的协议地址. 缩写:add、a
示例1:为每个地址设置一个字符串作为标签。为了和Linux-2.0的网络别名兼容,这个字符串必须以设备名开头,接着一个冒号,
# ip addr add local 192.168.4.1/28 brd + label eth0:1 dev eth0
示例2: 在以太网接口eth0上增加一个地址192.168.20.0,掩码长度为24位(155.155.155.0),标准广播地址,标签为eth0:Alias:
# ip addr add 192.168.4.2/24 brd + dev eth1 label eth1:1
这个命令等于传统的: ifconfig eth1:1 192.168.4.2
5.2 ip address delete--删除一个协议地址. 缩写:delete、del、d
# ip addr del 192.168.4.1/24 brd + dev eth0 label eth0:Alias1
5.3 ip address show--显示协议地址. 缩写:show、list、lst、sh、ls、l
# ip addr ls eth0
5.4.ip address flush--清除协议地址. 缩写:flush、f
示例1 : 删除属于私网10.0.0.0/8的所有地址:
# ip -s -s a f to 10/8
示例2 : 取消所有以太网卡的IP地址
# ip -4 addr flush label "eth0"
6. ip neighbour--neighbour/arp表管理命令
缩写 neighbour、neighbor、neigh、n
命令 add、change、replace、delete、fulsh、show(或list)
6.1 ip neighbour add -- 添加一个新的邻接条目
ip neighbour change--修改一个现有的条目
ip neighbour replace--替换一个已有的条目
缩写:add、a;change、chg;replace、repl
示例1: 在设备eth0上,为地址10.0.0.3添加一个permanent ARP条目:
# ip neigh add 10.0.0.3 lladdr 0:0:0:0:0:1 dev eth0 nud perm
示例2:把状态改为reachable
# ip neigh chg 10.0.0.3 dev eth0 nud reachable
6.2.ip neighbour delete--删除一个邻接条目
示例1:删除设备eth0上的一个ARP条目10.0.0.3
# ip neigh del 10.0.0.3 dev eth0
6.3.ip neighbour show--显示网络邻居的信息. 缩写:show、list、sh、ls
示例1: # ip -s n ls 193.233.7.254
193.233.7.254. dev eth0 lladdr 00:00:0c:76:3f:85 ref 5 used 12/13/20 nud reachable
6.4.ip neighbour flush--清除邻接条目. 缩写:flush、f
示例1: (-s 能显示周详信息)
# ip -s -s n f 193.233.7.254
7. 路由表管理
7.1.缩写 route、ro、r
7.5.路由表
从Linux-2.2开始,内核把路由归纳到许多路由表中,这些表都进行了编号,编号数字的范围是1到255。另外,
为了方便,还能在/etc/iproute2/rt_tables中为路由表命名。
默认情况下,所有的路由都会被插入到表main(编号254)中。在进行路由查询时,内核只使用路由表main。
7.6.ip route add -- 添加新路由
ip route change -- 修改路由
ip route replace -- 替换已有的路由
缩写:add、a;change、chg;replace、repl
示例1: 设置到网络10.0.0/24的路由经过网关193.233.7.65
# ip route add 10.0.0/24 via 193.233.7.65
示例2: 修改到网络10.0.0/24的直接路由,使其经过设备mmy
# ip route chg 10.0.0/24 dev mmy
示例3: 实现链路负载平衡.加入缺省多路径路由,让ppp0和ppp1分担负载(注意:scope值并非必需,他只不过是告诉内核,
这个路由要经过网关而不是直连的。实际上,如果你知道远程端点的地址,使用via参数来设置就更好了)。
# ip route add default scope global nexthop dev ppp0 nexthop dev ppp1
# ip route replace default scope global nexthop dev ppp0 nexthop dev ppp1
示例4: 设置NAT路由。在转发来自192.203.80.144的数据包之前,先进行网络地址转换,把这个地址转换为193.233.7.83
# ip route add nat 192.203.80.142 via 193.233.7.83
示例5: 实现数据包级负载平衡,允许把数据包随机从多个路由发出。weight 能设置权重.
# ip route replace default equalize nexthop via 211.139.218.145 dev eth0 weight 1 nexthop via 211.139.218.145 dev eth1 weight 1
7.7.ip route delete-- 删除路由
缩写:delete、del、d
示例1:删除上一节命令加入的多路径路由
# ip route del default scope global nexthop dev ppp0 nexthop dev ppp1
7.8.ip route show -- 列出路由
缩写:show、list、sh、ls、l
示例1: 计算使用gated/bgp协议的路由个数
# ip route ls proto gated/bgp |wc
1413 9891 79010
示例2: 计算路由缓存里面的条数,由于被缓存路由的属性可能大于一行,以此需要使用-o选项
# ip -o route ls cloned |wc
159 2543 18707
示例3: 列出路由表TABLEID里面的路由。缺省设置是table main。TABLEID或是个真正的路由表ID或是/etc/iproute2/rt_tables文件定义的字符串,
或是以下的特别值:
all -- 列出所有表的路由;
cache -- 列出路由缓存的内容。
ip ro ls 193.233.7.82 tab cache
示例4: 列出某个路由表的内容
# ip route ls table fddi153
示例5: 列出默认路由表的内容
# ip route ls
这个命令等于传统的: route
7.9.ip route flush -- 擦除路由表
示例1: 删除路由表main中的所有网关路由(示例:在路由监视程式挂掉之后):
# ip -4 ro flush scope global type unicast
示例2:清除所有被克隆出来的IPv6路由:
# ip -6 -s -s ro flush cache
示例3: 在gated程式挂掉之后,清除所有的BGP路由:
# ip -s ro f proto gated/bgp
示例4: 清除所有ipv4路由cache
# ip route flush cache
*** IPv4 routing cache is flushed.
7.10 ip route get -- 获得单个路由 .缩写:get、g
使用这个命令能获得到达目的地址的一个路由及他的确切内容。
ip route get命令和ip route show命令执行的操作是不同的。ip route show命令只是显示现有的路由,而ip route get命令在必要时会派生出新的路由。
示例1: 搜索到193.233.7.82的路由
# ip route get 193.233.7.82
193.233.7.82 dev eth0 src 193.233.7.65 realms inr.ac cache mtu 1500 rtt 300
示例2: 搜索目的地址是193.233.7.82,来自193.233.7.82,从eth0设备到达的路由(这条命令会产生一条非常有意思的路由,这是一条到193.233.7.82的回环路由)
# ip r g 193.233.7.82 from 193.233.7.82 iif eth0
193.233.7.82 from 193.233.7.82 dev eth0 src 193.233.7.65 realms inr.ac/inr.ac
cache mtu 1500 rtt 300 iif eth0
8. ip route -- 路由策略数据库管理命令
命令add、delete、show(或list)
注意:策略路由(policy routing)不等于路由策略(rouing policy)。
在某些情况下,我们不只是需要通过数据包的目的地址决定路由,可能还需要通过其他一些域:源地址、IP协议、传输层端口甚至数据包的负载。
这就叫做:策略路由(policy routing)。
8.5. ip rule add -- 插入新的规则
ip rule delete -- 删除规则
缩写:add、a;delete、del、d
示例1: 通过路由表inr.ruhep路由来自源地址为192.203.80/24的数据包
ip ru add from 192.203.80/24 table inr.ruhep prio 220
示例2:把源地址为193.233.7.83的数据报的源地址转换为192.203.80.144,并通过表1进行路由
ip ru add from 193.233.7.83 nat 192.203.80.144 table 1 prio 320
示例3:删除无用的缺省规则
ip ru del prio 32767
8.7. ip rule show -- 列出路由规则
缩写:show、list、sh、ls、l
示例1: # ip ru ls
0: from all lookup local
32762: from 192.168.4.89 lookup fddi153
32764: from 192.168.4.88 lookup fddi153
32766: from all lookup main
32767: from all lookup 253
9. ip maddress -- 多播地址管理
缩写:show、list、sh、ls、l
9.3.ip maddress show -- 列出多播地址
示例1: # ip maddr ls mmy
9.4. ip maddress add -- 加入多播地址
ip maddress delete -- 删除多播地址
缩写:add、a;delete、del、d
使用这两个命令,我们能添加/删除在网络接口上监听的链路层多播地址。这个命令只能管理链路层地址。
示例1: 增加 # ip maddr add 33:33:00:00:00:01 dev mmy
示例2: 查看 # ip -O maddr ls mmy
2: mmy
link 33:33:00:00:00:01 users 2 static
link 01:00:5e:00:00:01
示例3: 删除 # ip maddr del 33:33:00:00:00:01 dev mmy
10.ip mroute -- 多播路由缓存管理
10.4. ip mroute show -- 列出多播路由缓存条目
缩写:show、list、sh、ls、l
示例1:查看 # ip mroute ls
(193.232.127.6, 224.0.1.39) Iif: unresolved
(193.232.244.34, 224.0.1.40) Iif: unresolved
(193.233.7.65, 224.66.66.66) Iif: eth0 Oifs: pimreg
示例2:查看 # ip -s mr ls 224.66/16
(193.233.7.65, 224.66.66.66) Iif: eth0 Oifs: pimreg
9383 packets, 300256 bytes
11. ip tunnel -- 通道设置
缩写tunnel、tunl
11.4.ip tunnel add -- 添加新的通道
ip tunnel change -- 修改现有的通道
ip tunnel delete -- 删除一个通道
缩写:add、a;change、chg;delete、del、d
示例1:建立一个点对点通道,最大TTL是32
# ip tunnel add Cisco mode sit remote 192.31.7.104 local 192.203.80.1 ttl 32
11.4.ip tunnel show -- 列出现有的通道
缩写:show、list、sh、ls、l
示例1: # ip -s tunl ls Cisco
12. ip monitor和rtmon -- 状态监视
ip命令能用于连续地监视设备、地址和路由的状态。这个命令选项的格式有点不同,命令选项的名字叫做monitor,接着是操作对象:
ip monitor [ file FILE ] [ all | OBJECT-LIST ]
示例1: # rtmon file /var/log/rtmon.log
示例2: # ip monitor file /var/log/rtmon.log r