« squid maintain sample . chaotic sample:( |
Main
| 2. ip usage 1 - iproute2 - the most powerful tool - [FWD] ip命令手册(一) »
April 4, 2004
1. ip rule - iproute2 - the most powerful tool
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明。
https://windtear.net/archives/2004/04/04/000446.html
% rpm -qil iproute Name : iproute Relocations: (not relocateable) Version : 2.4.7 Vendor: Red Hat, Inc. Release : 7.73.1 Build Date: Tue 04 Nov 2003 12:09:59 AM CST Install date: Tue 23 Dec 2003 01:43:50 AM CST Build Host: stripples.devel.redhat.com Group : Applications/System Source RPM: iproute-2.4.7-7.73.1.src.rpm Size : 940710 License: GNU GPL Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> Summary : Advanced IP routing and network device configuration tools. Description : The iproute package contains networking utilities (ip and rtmon, for example) which are designed to use the advanced networking capabilities of the Linux 2.2.x kernel. /etc/iproute2 /etc/iproute2/rt_dsfield /etc/iproute2/rt_protos /etc/iproute2/rt_realms /etc/iproute2/rt_scopes /etc/iproute2/rt_tables /sbin/ifcfg /sbin/ip /sbin/rtmon /sbin/tc /usr/sbin/rtacct /usr/share/doc/iproute-2.4.7 /usr/share/doc/iproute-2.4.7/README.decnet /usr/share/doc/iproute-2.4.7/README.iproute2+tc /usr/share/doc/iproute-2.4.7/RELNOTES /usr/share/doc/iproute-2.4.7/api-ip6-flowlabels.ps /usr/share/doc/iproute-2.4.7/examples /usr/share/doc/iproute-2.4.7/examples/SYN-DoS.rate.limit /usr/share/doc/iproute-2.4.7/examples/cbqinit.eth1 /usr/share/doc/iproute-2.4.7/examples/dhcp-client-script /usr/share/doc/iproute-2.4.7/examples/diffserv /usr/share/doc/iproute-2.4.7/examples/diffserv/Edge1 /usr/share/doc/iproute-2.4.7/examples/diffserv/Edge2 /usr/share/doc/iproute-2.4.7/examples/diffserv/Edge31-ca-u32 /usr/share/doc/iproute-2.4.7/examples/diffserv/Edge31-cb-chains /usr/share/doc/iproute-2.4.7/examples/diffserv/Edge32-ca-u32 /usr/share/doc/iproute-2.4.7/examples/diffserv/Edge32-cb-chains /usr/share/doc/iproute-2.4.7/examples/diffserv/Edge32-cb-u32 /usr/share/doc/iproute-2.4.7/examples/diffserv/README /usr/share/doc/iproute-2.4.7/examples/diffserv/afcbq /usr/share/doc/iproute-2.4.7/examples/diffserv/ef-prio /usr/share/doc/iproute-2.4.7/examples/diffserv/efcbq /usr/share/doc/iproute-2.4.7/examples/diffserv/regression-testing /usr/share/doc/iproute-2.4.7/ip-cref.ps /usr/share/doc/iproute-2.4.7/ip-tunnels.ps /usr/share/man/man8/ip.8.gz
-----> a sample % cat /etc/iproute2/rt_tables # # reserved values # #255 local #254 main #253 default #0 unspec
# # local # #1 inr.ruhep 210 cenpok 220 lab
% tail ....sh
# adv route $IP route add default via a.b.c.d src h.i.j.k dev cenpok table cenpok $IP rule add from h.i.j.k table cenpok
$IP route add default via a.b.c.e src h.i.j.l dev lab table lab $IP rule add from h.i.j.l table lab
$IP route flush cache
-----> view the fact % ip rule ls 0: from all lookup local 32764: from h.i.j.l lookup lab 32765: from h.i.j.k lookup cenpok 32766: from all lookup main 32767: from all lookup 253
% ip route ls table cenpok default via a.b.c.d dev cenpok src h.i.j.k
% ip route ls table lab default via a.b.c.e dev lab src h.i.j.l
|
|
Posted by windtear at April 4, 2004 1:35 AM