BGP穿过防火墙配置.doc_第1页
BGP穿过防火墙配置.doc_第2页
BGP穿过防火墙配置.doc_第3页
BGP穿过防火墙配置.doc_第4页
BGP穿过防火墙配置.doc_第5页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

BGP穿过防火墙配置BGP穿过防火墙配置2010-12-08 15:38透明防火墙就是模拟一台两口的二层设备,它在网络中部署的方便之处就是不用重新规划网络边缘的IP地址。路由流量在穿越透明防火墙的时候与穿越一般的二层设备有一些不同,因为防火墙默认情况下对一些类型的流量的过滤所以需要我们手动的去放行这类流量使得路由信令通过。例如运行OSPF的时候我们就需要配置访问控制列表:access-list 100 ext per ospf an an,调用这个ACL也是一个需要注意的地方,一般情况下,防火墙默认允许高到低的安全级别访问,但是运行OSPF和EIGRP的时候,需要双向放行,也就是说inside接口也需要放行:access-group 100 in inter outside access-group 100 in inter inside。如果我们运行BGP的话,则有一些小区别。下面的小实验简单搭建一个环境来模拟建立BGP时需要注意的问题。拓扑:说明:两台路由器,Inside模拟内部网络的CE,中间是PIX防火墙,外面的Outside模拟外部网络的PE。-透明防火墙的初始配置-!pixfirewall#conf tpixfirewall(config)#host FW FW(config)#show mode#查看当前的模式,单模式Security context mode:single FW(config)#sh firewall#查看防火墙的模式,透明模式Firewall mode:Transparent FW(config)#FW(config)#ip add 12.1.1.3 255.255.255.0#!配置管理IP,一定要配,否则拒绝流量FW(config)#int e0 FW(config-if)#nameif inside#e0接inside FW(config-if)#no shut FW(config-if)#FW(config-if)#int e1 FW(config-if)#nameif outside#e1接outside FW(config-if)#no shut FW(config-if)#exi FW(config)#FW(config)#access-list 100 ext per icmp an an#先配一个ACL运行ICMP用作PING测试FW(config)#access-group 100 in int outside#在outside接口调用FW(config)#FW(config)#sh nameif#配置查看Interface Name Security Ethernet0 inside 100 Ethernet1 outside 0FW(config)#sh ip add#配置查看Management System IP Address:ip address 12.1.1.3 255.255.255.0 Management Current IP Address:ip address 12.1.1.3 255.255.255.0 FW(config)#sh int ip bri#配置查看Interface IP-Address OK?Method Status Protocol Ethernet0 12.1.1.3 YES unset up up Ethernet1 12.1.1.3 YES unset up up Ethernet2 unassigned YES unset administratively down up Ethernet3 unassigned YES unset administratively down up Ethernet4 unassigned YES unset administratively down up-路由的初始配置-下面是inside和outside的配置。Inside!interface Loopback0 ip address 192.168.10.1 255.255.255.0 ip ospf network point-to-point!interface FastEthernet0/0 ip address 12.1.1.1 255.255.255.0 speed 100 full-duplex!router bgp 1no synchronization bgp router-id 1.1.1.1 bgp log-neighbor-changes network 192.168.10.0 neighbor 12.1.1.2 remote-as 1no auto-summary!Outside!interface Loopback0 ip address 192.168.20.1 255.255.255.0 ip ospf network point-to-point!interface FastEthernet0/0 ip address 12.1.1.2 255.255.255.0 speed 100 full-duplex!router bgp 1no synchronization bgp router-id 2.2.2.2 bgp log-neighbor-changes network 192.168.20.0 neighbor 12.1.1.1 remote-as 1no auto-summary!-BGP会话建立情况-默认情况下如果不放行BGP的通信流量的话,BGP会话是建立不起来的。Inside#sh ip bs BGP router identifier 1.1.1.1,local AS number 1BGP table version is 3,main routing table version 3Neighbor VAS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 12.1.1.2 41 36 35 00 000:00:05 Active他们会一直卡在ACTIVE状态。卡在ACTIVE状态说明发送OPEN包,核实BGP建立参数这个阶段失败。解决方法就是在FW上放行BGP流量。-放行BGP流量-access-list 100 ext per tcp ho 12.1.1.1 ho 12.1.1.2 eq bgp因为BGP是使用TCP 179端口建立连接的,所以放行流量按上面方式写。这里我测试了一下,因为12.1.1.1到12.1.1.2是默认的高到低的安全级别访问,如果我反着来写,也就是access-list 100 ext per tcp ho 12.1.1.2 ho 12.1.1.1 eq bgp,然后去清一下BGP进程,结果是:BGP会话依然能够建立。Inside#sh ip bs Neighbor VAS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 12.1.1.2 41 73 72 30 000:06:38 1Inside#ping 192.168.20.1 sou l0 re 10 Type escape sequence to abort.Sending 10,100-byte ICMP Echos to 192.168.20.1,timeout is 2seconds:Packet sent with asource address of 192.168.10.1!Success rate is 100 percent(10/10),round-trip min/avg/max=16/57/96 ms-注意-注意上面调用ACL的时候,并没有跟放行EIGRP和OSPF那样在inside接口和outside接口都放行。这是BGP的一个特殊之处,因为TCP是有连接的,在outside端口放行即可。-BGP加密会话穿越透明防火墙-如果BGP会话加密的话,那么默认情况下是无法穿越透明防火墙的。这是因为防火墙出于安全的考虑,默认情况下会打开TCP序列号随机化的小特性,另外防火墙会擦出TCP的一些选项位,在BGP加密会话中,19号选项位包含了MD5加密的属性信息,防火墙清除这个字段后的后果就是加密的BGP会话建立不起来。Inside#conf tEnter configuration commands,one per line.End with CNTL/Z.Inside(config)#router b1 Inside(config-router)#nei 12.1.1.2 password 5helloworld#加密会话Inside(config-router)#end Inside#Inside#cle ip b*Mar 102:01:01.123:%SYS-5-CONFIG_I:Configured from console by console Inside#*Mar 102:01:03.935:%BGP-5-ADJCHANGE:neighbor 12.1.1.2 Down User reset Inside#*Mar 102:01:08.019:%TCP-6-BADAUTH:No MD5 digest from 12.1.1.2(18033)to 12.1.1.1(179)如上所示,在两端都配置了相同的password后给出的输出是没有从对方接受到MD5加密的信息。解决这个问题的方法就是针对透明防火墙的特性,关闭随机化TCP序列号并放行19号字段。-解决方法-tcp-map BGP tcp-options range 19 19 allow#允许TCP包头中的option字段的19号选项位!class-map BGP-1 match port tcp eq bgp#class-map中定义了这个应用是BGP!policy-map global_policy#这个是系统内置的policy-map,已经被全局调用了class BGP-1 set connection random-sequence-number disable#关不随机话TCP序列set connection advanced-options BGP#调用前面的TCP-MAP BGP-分割线-因为global_policy是默认全局启用的,所以不用我们再去启用一遍。此时inside和outside的会话已经建立起来了。Inside#*Mar 102:08:36.199:%BGP-5-ADJCHANGE:neighbor 12.1.1.2 Up Inside#sh ip bs Neighbor VAS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 12.1.1.2 41 92 91 30 000:07:55 10 00:07:59 1Inside#sh ip bBGP table version is 3,local router ID is 1.1.1.1

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论