华为防火墙配置指南

2025-05-20 12:43:21

1、步骤一.基本配置与IP编址首先给三个路由器配置地址信息。[Huawei]sy衡痕贤伎sname R1[R1]interface g0/0/1[R1-GigabitEthernet0/0/1]ip add 10.0.10.124[R1-GigabitEthernet0/0/1]desc this portconnect to S1-G0/0/1[R1-GigabitEthernet0/0/1]interfaceloopback0[R1-LoopBack0]ip add 10.0.1.1 24[R1-LoopBack0]q[Huawei]sysname R2[R2]interface g0/0/1[R2-GigabitEthernet0/0/1]ip add 10.0.20.224[R2-GigabitEthernet0/0/1]desc this portconnect to S1-G0/0/2[R2-GigabitEthernet0/0/1]interfaceloopback0[R2-LoopBack0]ip add 10.0.2.2 24[R2-LoopBack0]q[Huawei]sysname R3[R3]interface g0/0/1[R3-GigabitEthernet0/0/1]ip add 10.0.30.324[R3-GigabitEthernet0/0/1]desc this portconnect to S1-G0/0/3[R3-GigabitEthernet0/0/1]interfaceloopback0[R3-LoopBack0]ip add 10.0.3.3 24[R3-LoopBack0]q给防火墙配置地址时,G0/0/1配置10.0.20.254/24.[SRG]sysname FW13:06:032014/07/08[FW]interface g0/0/113:06:302014/07/08[FW-GigabitEthernet0/0/1]ip add 10.0.20.2542413:07:012014/07/08[FW-GigabitEthernet0/0/1]desc this portconnect to S1-G0/0/2213:07:522014/07/08[FW-GigabitEthernet0/0/1]interface g0/0/013:08:232014/07/08[FW-GigabitEthernet0/0/0]dis this13:08:312014/07/08#interface GigabitEthernet0/0/0alias GE0/MGMTipaddress 192.168.0.1 255.255.255.0dhcpselect interfacedhcpserver gateway-list 192.168.0.1#return[FW-GigabitEthernet0/0/0]undo ip add13:08:422014/07/08Info: The DHCP server configuration on thisinterface will be deleted.[FW-GigabitEthernet0/0/0]display this13:08:462014/07/08#interface GigabitEthernet0/0/0alias GE0/MGMT#return[FW-GigabitEthernet0/0/0]ip add 10.0.10.2542413:09:292014/07/08[FW-GigabitEthernet0/0/0]desc this portconnect to S1-G0/0/2113:10:052014/07/08[FW-GigabitEthernet0/0/0]interface G0/0/213:10:152014/07/08[FW-GigabitEthernet0/0/2]ip add 10.0.30.2542413:10:282014/07/08[FW-GigabitEthernet0/0/2]desc this portconnect to S1-G0/0/2313:10:532014/07/08[FW-GigabitEthernet0/0/2]q

华为防火墙配置指南

3、步骤二.将接口配置到安全区域防火墙默认有四个区域,分别是“local”、“trust"、“untrust”、“dmz”。实验中我们用到“trust”、'untrust"、“dmz”三个区域。将G0/0/0加入untrust区域、g/0/0/2加入dmz和g/0/0/1加入trust。[FW]firewall zone trust13:45:312014/07/08[FW-zone-trust]dis this13:45:352014/07/08#firewall zone trustsetpriority 85addinterface GigabitEthernet0/0/0#return[FW-zone-trust]undo add inter[FW-zone-trust]undo add interface g0/0/013:46:012014/07/08[FW-zone-trust]add interface g0/0/113:46:222014/07/08[FW-zone-trust]firewall zone untrust[FW-zone-untrust]add interface g0/0/013:47:242014/07/08[[FW-zone-untrust]firewall zone dmz13:48:062014/07/08[FW-zone-dmz]add interface g0/0/213:48:13 2014/07/08[FW-zone-dmz]q

华为防火墙配置指南

5、步骤三.配置静态路由,实现网络的连通性在R2和R3上配置缺省路由,在FW上配置明确的静态路由,实现三个loopback0接口之间的通信。R1无需定义缺省路由,原因是其作为internet设备,他不需要知道内部和DMZ区域的私有网络信息。[R2]ip route-static 0.0.0.0 0 10.0.20.254[R3]ip route-static 0.0.0.0 0 10.0.30.254[FW]ip route-static 10.0.1.0 24 10.0.10.113:58:262014/07/08[FW]ip route-static 10.0.2.0 24 10.0.20.213:58:402014/07/08[FW]ip route-static 10.0.3.0 24 10.0.30.313:58:522014/07/08在防火墙上测试与10.0.1.0、10.0.2.0、10.0.3.0之间的连通性。[FW]ping -c 1 10.0.1.114:00:182014/07/08PING 10.0.1.1: 56 data bytes,press CTRL_C to breakReply from 10.0.1.1: bytes=56 Sequence=1 ttl=255 time=80 ms ---10.0.1.1 ping statistics --- 1packet(s) transmitted 1packet(s) received0.00% packet lossround-trip min/avg/max = 80/80/80 ms[FW]ping -c 1 10.0.2.214:00:252014/07/08PING 10.0.2.2: 56 data bytes,press CTRL_C to breakReply from 10.0.2.2: bytes=56 Sequence=1 ttl=255 time=170 ms ---10.0.2.2 ping statistics --- 1packet(s) transmitted 1packet(s) received0.00% packet lossround-trip min/avg/max = 170/170/170 ms[FW]ping -c 1 10.0.3.314:00:292014/07/08PING 10.0.3.3: 56 data bytes,press CTRL_C to breakReply from 10.0.3.3: bytes=56 Sequence=1 ttl=255 time=110 ms ---10.0.3.3 ping statistics --- 1packet(s) transmitted 1packet(s) received0.00% packet lossround-trip min/avg/max = 110/110/110 ms目前配置下,所有区域之间可以通讯,不被检查。但是由于当前尚未定义NAT,外部区域不能与内部和DMZ区域相互访问。

华为防火墙配置指南

7、步骤五.配置Easy-Ip,实现Trust区域到Untrust区域的访问。配醅呓择锗置使用Easy-IP,进行NAT源地址转换。并且将NAT与接口进行绑定。[FW-n锾攒揉敫at-policy-interzone-trust-untrust-outbound]policy014:14:002014/07/08[FW-nat-policy-interzone-trust-untrust-outbound-0]policysource 10.0.2.0 0.0.0.25514:14:262014/07/08[FW-nat-policy-interzone-trust-untrust-outbound-0]actionsource-nat14:14:372014/07/08[FW-nat-policy-interzone-trust-untrust-outbound-0]easy-ipg0/0/014:14:512014/07/08[FW-nat-policy-interzone-trust-untrust-outbound-0]q配置完成后,验证Trust区域与Untrust区域之间的访问是否正常。<R2>ping 10.0.1.1PING 10.0.1.1: 56 data bytes,press CTRL_C to breakRequest time outRequest time outRequest time outRequest time outRequest time out ---10.0.1.1 ping statistics --- 5packet(s) transmitted 0packet(s) received100.00% packet loss<R2>ping -a 10.0.2.2 10.0.1.1PING 10.0.1.1: 56 data bytes,press CTRL_C to breakReply from 10.0.1.1: bytes=56 Sequence=1 ttl=254 time=220 msReply from 10.0.1.1: bytes=56 Sequence=2 ttl=254 time=100 msReply from 10.0.1.1: bytes=56 Sequence=3 ttl=254 time=100 msReply from 10.0.1.1: bytes=56 Sequence=4 ttl=254 time=120 msReply from 10.0.1.1: bytes=56 Sequence=5 ttl=254 time=440 ms ---10.0.1.1 ping statistics --- 5packet(s) transmitted 5packet(s) received0.00% packet lossround-trip min/avg/max = 100/196/440 ms注意,这里直接测试与10.0.1.1之间的连通性,显示不通。使用扩展ping,指定了发送数据包的源地址是10.0.2.2后,实现了连通性。原因是,直接发送数据包到10.0.1.1时,数据包的源地址到10.0.1.1时,数据包的源地址为10.0.20.2,该地址不属于NAT转换的客户端地址范围。步骤六.将内网服务器10.0.3.3发布出去配置内网服务器10.0.3.3的telnet服务,映射到地址10.0.10.20[FW]nat server protocol tcp global10.0.10.20 telnet inside 10.0.3.3 telnet在R3上开启Telnet功能,并在R1上测试,测试时需要注意,对外发布的地址为10.0.10.20,所以R1对10.0.3.3访问时,访问的目标地址为10.0.10.20。[R3]user-interface vty 0 4[R3-ui-vty0-4]authentication-mode passwordPlease configure the login password(maximum length 16):16[R3-ui-vty0-4]set authentication password ?cipher Set the password withcipher text[R3-ui-vty0-4]set authentication passwordcip[R3-ui-vty0-4]set authentication passwordcipher Huawei[R3-ui-vty0-4]user privilege level 3[R3-ui-vty0-4]q<R1>telnet 10.0.10.20Press CTRL_] to quit telnet modeTrying 10.0.10.20 ...Connected to 10.0.10.20 ...

华为防火墙配置指南
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢