您好,欢迎访问三七文档
当前位置:首页 > IT计算机/网络 > C/C++资料 > H3C防火墙F100-C-G2的NAT配置
1.Firewall的配置#指定GigabitEthernet1/0/1端口的电口被激活,使用双绞线连接H3Csystem-view[H3C]interfacegigabitethernet1/0/1[H3C-GigabitEthernet1/0/1]comboenablecopper[H3C-GigabitEthernet1/0/1]quit#按照组网图配置各接口的IP地址。Sysnamesystem-view[Sysname]interfacegigabitethernet1/0/1[Sysname-GigabitEthernet1/0/1]portlink-moderoute[Sysname-GigabitEthernet1/0/1]ipaddress10.110.10.10255.255.255.0[Sysname-GigabitEthernet1/0/1]quit[Sysname]interfacegigabitethernet1/0/2[Sysname-GigabitEthernet1/0/2]portlink-moderoute[Sysname-GigabitEthernet1/0/2]ipaddress202.38.1.1255.255.255.0[Sysname-GigabitEthernet1/0/2]quit#创建安全域,并将不同的接口加入不同的安全域。[Sysname]security-zonenameTrust[Sysname-security-zone-Trust]importinterfacegigabitethernet1/0/1[Sysname-security-zone-Trust]quit[Sysname]security-zonenameUntrust[Sysname-security-zone-Untrust]importinterfacegigabitethernet1/0/2[Sysname-security-zone-Untrust]quit#配置访问控制列表2001,仅允许内部网络中10.110.10.0/24网段的用户可以访问Internet。[Sysname]aclnumber2001[Sysname-acl-basic-2001]rulepermitsource10.110.10.00.0.0.255[Sysname-acl-basic-2001]ruledeny[Sysname-acl-basic-2001]quit#配置域间策略,应用ACL2001进行报文过滤。[Sysname]zone-pairsecuritysourceTrustdestinationUntrust[Sysname-zone-pair-security-Trust-Untrust]packet-filter2001[Sysname-zone-pair-security-Trust-Untrust]quit#配置IP地址池1,包括两个公网地址202.38.1.2和202.38.1.3。[Sysname]nataddress-group1[Sysname-address-group-1]address202.38.1.2202.38.1.3[Sysname-address-group-1]quit#在出接口GigabitEthernet1/0/2上配置ACL2001与IP地址池1相关联。NO-PAT方式:进行源地址转换,不转换源端口[Sysname]interfacegigabitethernet1/0/2[Sysname-GigabitEthernet1/0/2]natoutbound2001address-group1no-pat[Sysname-GigabitEthernet1/0/2]quitPAT方式:进行源地址转换,同时转换源端口[Sysname]interfacegigabitethernet1/0/2[Sysname-GigabitEthernet1/0/2]natoutbound2001address-group1[Sysname]interfacegigabitethernet1/0/2PAT方式:进行源地址转换,但不转换源端口[Sysname-GigabitEthernet1/0/2]natoutbound2001address-group1port-preserved[Sysname-GigabitEthernet1/0/2]quit6.3验证配置(1)上述配置完成后,内网主机可以访问外网服务器。通过查看如下显示信息,可以验证上述配置成功,以PAT方式为例。[Sysname]displaynatall[Sysname]displaynatsessionverboseSysnamedisplaycurrent-configuration2.如果不行的话,需要如下配置iproute-static0.0.0.00.0.0.010.110.10.10[H3C]security-zoneintra-zonedefaultpermit//配置同一安全域内接口间报文处理的缺省动作为permit[H3C]object-policyipTrust-Untrust//创建Trust到Untrst的地址对象策略[H3C-object-policy-ip-Trust-Untrust]rule0pass//规则为允许[H3C-object-policy-ip-Trust-Untrust]quit[H3C]zone-pairsecuritysourceTrustdestinationUntrust//放通Turst到Untrust的域间策略[H3C-zone-pair-security-Trust-Untrust]object-policyapplyipTrust-Untrust//引用Trust到Untrst的地址对象策略[H3C-object-policy-ip-Trust-Untrust]quit1.Firewall的配置(1)指定GigabitEthernet1/0/1端口的电口被激活,使用双绞线连接system-viewinterfacegigabitethernet1/0/1comboenablecopperquit(2)按照组网图配置各接口的IP地址。system-viewinterfacegigabitethernet1/0/1portlink-moderouteipaddress192.168.88.88255.255.255.0quitinterfacegigabitethernet1/0/2portlink-moderouteipaddress192.168.123.254255.255.255.0quit(3)#创建安全域,并将不同的接口加入不同的安全域。G1/0/2192.168.123.254/23G1/0/1192.168.88.88/24security-zonenameTrustimportinterfacegigabitethernet1/0/2quitsecurity-zonenameUntrustimportinterfacegigabitethernet1/0/1quit(4)#配置访问控制列表2001,仅允许内部网络中192.168.123.0/23网段的用户可以访问Internet。aclnumber2001rulepermitsource192.168.123.00.0.0.127quit(5)#配置域间策略,应用ACL2001进行报文过滤。zone-pairsecuritysourceTrustdestinationUntrustpacket-filter2001quit(6)#配置IP地址池1,包括两个公网地址192.168.88.88和192.168.89。nataddress-group1address192.168.88.88192.168.88.89quit(7)#在出接口GigabitEthernet1/0/2上配置ACL2001与IP地址池1相关联。PAT方式:进行源地址转换,同时转换源端口interfacegigabitethernet1/0/1natoutbound2001address-group1port-preservedquit6.3验证配置(1)上述配置完成后,内网主机可以访问外网服务器。通过查看如下显示信息,可以验证上述配置成功,以PAT方式为例。[Sysname]displaynatall[Sysname]displaynatsessionverboseSysnamedisplaycurrent-configuration
本文标题:H3C防火墙F100-C-G2的NAT配置
链接地址:https://www.777doc.com/doc-7027436 .html