欢迎来到天天文库
浏览记录
ID:43962878
大小:106.18 KB
页数:5页
时间:2019-10-17
《基于Linux策略路由的实现》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、基于Linux策略路由的实现作者:来源:cqs1015.cublog.cn发表时间:2006-12-12浏览次数:107字号:人中小基于LINUX策略路由的实现一、网络结构ethO10.43.128.10gw10.43.0.254->interneleth161.144.64.106gw61.144.64.1・->interneleth2192.168.0.2gw192.168.0.1->internel二、实现廿的:1.不改变现有网络拓扑结构。2.根据目的地址确定数据走向,所有到10.45.0.0/16、10.10.0.0/16的走10.43.0.254。3.根据源
2、地址确定数据走向,10.43.128.63走adsl路由,其它走默认main路由。三、软件要求:IPROUTE[root@ADSLroot]#rpm-qa
3、grepiproute(查看是否有iproute软件包)iproute-2.4.7-7.AS21.1四、实现步骤:[root@ADSLroot]#iplink(查看本地链路)1:Io:vLOOPBACK,UP>mtu16436qdiscnoqueuelink/loopback00:00:00:00:00:00brd00:00:00:00:00:002:ethO:4、C,UP>mtu1500qdiscpfifo_fastqlen100link/ether00:90:27:99:1d:fabrdff:ff:ff:ff:ff:ff3:eth1:mtu1500qdiscpfifo_fastqlen100link/ether00:40:05:11:fe:78brd4:eth2:mtu1500qdiscpfifo_fastqlen100link/ether00:40:05:42:65:88brd[root@ADSLroot]#ipadd(查看本地5、地址)1:Io:mtu16436qdiscnoqueuelink/loopback00:00:00:00:00:00brd00:00:00:00:00:00inet127.0.0.1/8brd127.255.255.255scopehostIo2:ethO:mtu1500qdiscpfifo_fastqlen100link/ether00:90:27:99:1d:fabrdff:ff:ff:ff:ff:ffinet10.43.128.10/16brd10.43.255.255sc6、opeglobalethO3:eth1:mtu1500qdiscpfifo_fastqlen100link/ether00:40:05:11:fe:78brdinet61.144.64.106/24brd61.144.64.255scopeglobaleth14:eth2:mtu1500qdiscpfifo_fastqlen100link/ether00:40:05:42:65:88brdinet192.168.0.2/24brd192.168.0.255scopeglob7、aleth2[root@ADSLroot]#iproute(查看本地路由和iprouteIstablemain或route命令相等)192.168.0.0/24deveth2scopelink61.144.64.0/24deveth1scopelink10.10.0.0/16via10.43.0.254devethO10.43.0.0/16devethOscopelink10.45.0.0/16via10.43.0.254devethO127.0.0.0/8devIoscopelinkdefaultvia61.144.64.1deveth1[root@ADSLroot8、]#iprule(查看本地路山策略)0:fromalllookuplocal(本地路由表系统默认id=255,优先级0)32766:fromalllookupmain(默认的标准路山衣id=254,优先级32766)32767:fromalllookupdefault(本地默认路由表系统默认id=253,优先级32767)(添加一个新的路市表)[root@ADSLroot]#iprouteadd10.10.0.0/16via10.43.0.254devethOtableadsl[root@ADSLroot]#iprouteadd10.45.0.0/1
4、C,UP>mtu1500qdiscpfifo_fastqlen100link/ether00:90:27:99:1d:fabrdff:ff:ff:ff:ff:ff3:eth1:mtu1500qdiscpfifo_fastqlen100link/ether00:40:05:11:fe:78brd4:eth2:mtu1500qdiscpfifo_fastqlen100link/ether00:40:05:42:65:88brd[root@ADSLroot]#ipadd(查看本地
5、地址)1:Io:mtu16436qdiscnoqueuelink/loopback00:00:00:00:00:00brd00:00:00:00:00:00inet127.0.0.1/8brd127.255.255.255scopehostIo2:ethO:mtu1500qdiscpfifo_fastqlen100link/ether00:90:27:99:1d:fabrdff:ff:ff:ff:ff:ffinet10.43.128.10/16brd10.43.255.255sc
6、opeglobalethO3:eth1:mtu1500qdiscpfifo_fastqlen100link/ether00:40:05:11:fe:78brdinet61.144.64.106/24brd61.144.64.255scopeglobaleth14:eth2:mtu1500qdiscpfifo_fastqlen100link/ether00:40:05:42:65:88brdinet192.168.0.2/24brd192.168.0.255scopeglob
7、aleth2[root@ADSLroot]#iproute(查看本地路由和iprouteIstablemain或route命令相等)192.168.0.0/24deveth2scopelink61.144.64.0/24deveth1scopelink10.10.0.0/16via10.43.0.254devethO10.43.0.0/16devethOscopelink10.45.0.0/16via10.43.0.254devethO127.0.0.0/8devIoscopelinkdefaultvia61.144.64.1deveth1[root@ADSLroot
8、]#iprule(查看本地路山策略)0:fromalllookuplocal(本地路由表系统默认id=255,优先级0)32766:fromalllookupmain(默认的标准路山衣id=254,优先级32766)32767:fromalllookupdefault(本地默认路由表系统默认id=253,优先级32767)(添加一个新的路市表)[root@ADSLroot]#iprouteadd10.10.0.0/16via10.43.0.254devethOtableadsl[root@ADSLroot]#iprouteadd10.45.0.0/1
此文档下载收益归作者所有