哪个范围用于路由表

我有2个接口。 一个广域网和其他互联网(这个没有国家互联网交换路由)。 我通常从我的地区的同行findIP,然后在apnic.net中search。 在那里我只使用2个字段, inetnum路由

例如,我search这个IP XXX.YYY.7.117。 在apnic上search这个我发现以下两个字段。

inetnum: XXX.YYY.0.0 - XXX.YYY.31.255 route: XXX.YYY.7.0/24 

我想要的是将这些IP(inetnum)的所有stream量传递到WAN接口。 如果我计算范围,我发现CIDR符号XXX.YYY.0.0/19 。 所以XXX.YYY.0.0/19包含在inetnum范围内find的所有IP。 但路线有XXX.YYY.7.0/24 。 两者都不同。 添加到我的路由表时应该使用哪一个?

以下哪个命令将用于我的目的?

 route add -net `XXX.YYY.0.0/19` gw MY_IP dev WAN route add -net `XXX.YYY.7.0/24` gw MY_IP dev WAN 

当我查找58.97.129.36时,对前缀长度没有困惑… APNIC将其列为/17块。 因此,您应该将此路由添加为适当的WAN / MAN连接的/17

你真的应该考虑一个静态的默认出你的WAN接口,然后运行BGP与这些目的地出城市,使用dynamic协议pipe理路由要容易得多。 这需要一个真正的路由器(而不是你现在所做的主机级路由),但是我认为从长远来看,你将拥有一个更加可维护的networking。


 $ gwhois -h whois.arin.net 58.97.129.36 Process query: '58.97.129.36' Querying whois.arin.net:43 with whois. Querying whois.apnic.net:43 with whois. % [whois.apnic.net node-3] % Whois data copyright terms http://www.apnic.net/db/dbcopyright.html inetnum: 58.97.128.0 - 58.97.255.255 netname: BANGLALION-WIMAX-BD descr: Silver Tower (16 & 18th Floor) country: BD admin-c: BCLn1-AP tech-c: BCLn1-AP status: ALLOCATED PORTABLE remarks: Used for WiMAX mnt-by: APNIC-HM mnt-lower: MAINT-BANGLALION-WIMAX-BD mnt-routes: MAINT-BANGLALION-WIMAX-BD mnt-irt: IRT-BANGLALION-WIMAX-BD remarks: -+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+ remarks: This object can only be updated by APNIC hostmasters. remarks: To update this object, please contact APNIC remarks: hostmasters and include your organisation's account remarks: name in the subject line. remarks: -+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+ changed: [email protected] 20110107 source: APNIC route: 58.97.128.0/17 descr: Route Object for 58.97.128.0.0/17 origin: AS45904 country: BD remarks: New /17 block of Banglalion WiMAX mnt-lower: MAINT-BANGLALION-WIMAX-BD mnt-routes: MAINT-BANGLALION-WIMAX-BD mnt-by: MAINT-BANGLALION-WIMAX-BD changed: [email protected] 20110117 source: APNIC role: BANGLALION COMMUNICATIONS LTD - network administr address: Silver Tower (16 & 18th Floor), 52 Gulshan Avenue, Gulshan, Dhaka-1212. Bangladesh. country: BD phone: +88028816349 fax-no: +8802-9885647 e-mail: [email protected] admin-c: BCLn1-AP tech-c: AHC2-AP nic-hdl: BCLn1-AP mnt-by: MAINT-BANGLALION-WIMAX-BD changed: [email protected] 20090831 source: APNIC changed: [email protected] 20100825 -- To resolve one of the above handles: whois -h whois.arin.net HANDLE OTOH offical handles should be recognised directly. Please report errors or misfits via the debian bug tracking system. 

 $ gwhois -h whois.arin.net 123.200.7.22 Process query: '123.200.7.22' Querying whois.arin.net:43 with whois. Querying whois.apnic.net:43 with whois. % [whois.apnic.net node-2] % Whois data copyright terms http://www.apnic.net/db/dbcopyright.html inetnum: 123.200.0.0 - 123.200.31.255 netname: LINK3 descr: Link3 Technologies Ltd. descr: Internet Service Provider, Dhaka, Bangladesh country: BD admin-c: SP349-AP tech-c: SP349-AP mnt-by: APNIC-HM mnt-lower: MAINT-BD-LINK3 mnt-routes: MAINT-BD-LINK3 status: ALLOCATED PORTABLE remarks: -+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+ remarks: This object can only be updated by APNIC hostmasters. remarks: To update this object, please contact APNIC remarks: hostmasters and include your organisation's account remarks: name in the subject line. remarks: -+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+ changed: [email protected] 20070111 source: APNIC route: 123.200.7.0/24 descr: route object for 123.200.7.0/24 country: BD origin: AS23688 mnt-lower: MAINT-BD-LINK3 mnt-routes: MAINT-BD-LINK3 mnt-by: MAINT-BD-LINK3 changed: [email protected] 20110829 source: APNIC person: Sajjid Pasha address: Bulu Ocean Tower, 17th Floor, address: 40, Kemal Ataturk Avenue, Banani, address: Dhaka 1213 address: Bangladesh country: BD phone: +88-02-9894500 fax-no: +88-02-9888642 e-mail: [email protected] nic-hdl: SP349-AP mnt-by: MAINT-BD-LINK3 changed: [email protected] 20101127 source: APNIC -- To resolve one of the above handles: whois -h whois.arin.net HANDLE OTOH offical handles should be recognised directly. Please report errors or misfits via the debian bug tracking system. 

 $ telnet route-views.oregon-ix.net Trying 128.223.51.103... Connected to route-views.oregon-ix.net. Escape character is '^]'. ********************************************************************** Oregon Exchange BGP Route Viewer route-views.oregon-ix.net / route-views.routeviews.org route views data is archived on http://archive.routeviews.org This hardware is part of a grant from Cisco Systems. Please contact [email protected] if you have questions or comments about this service, its use, or if you might be able to contribute your view. This router has views of the full routing tables from several ASes. The list of ASes is documented under "Current Participants" on http://www.routeviews.org/. ************** route-views.routeviews.org is now using AAA for logins. Login with username "rviews". See http://routeviews.org/aaa.html ********************************************************************** User Access Verification Username: rviews route-views>sh ip route 123.200.7.22 Routing entry for 123.200.0.0/21 Known via "bgp 6447", distance 20, metric 0 Tag 1239, type external Last update from 144.228.241.130 1d21h ago Routing Descriptor Blocks: * 144.228.241.130, from 144.228.241.130, 1d21h ago Route metric is 0, traffic share count is 1 AS Hops 7 Route tag 1239 route-views>