配置NAT Outbound示例
[史上最详细]H3C路由器NAT典型配置案例
![[史上最详细]H3C路由器NAT典型配置案例](https://img.taocdn.com/s3/m/882e4d6942323968011ca300a6c30c225801f060.png)
H3C路由器NAT典型配置案列(史上最详细)神马CCIE,H3CIE,HCIE等网络工程师日常实施运维必备,你懂的。
1.11 NAT典型配置举例1.11.1 内网用户通过NAT地址访问外网(静态地址转换)1. 组网需求内部网络用户10.110.10.8/24使用外网地址202.38.1.100访问Internet。
2. 组网图图1-5 静态地址转换典型配置组网图3. 配置步骤# 按照组网图配置各接口的IP地址,具体配置过程略。
# 配置内网IP地址10.110.10.8到外网地址202.38.1.100之间的一对一静态地址转换映射。
<Router> system-view[Router] nat static outbound 10.110.10.8 202.38.1.100# 使配置的静态地址转换在接口GigabitEthernet1/2上生效。
[Router] interface gigabitethernet 1/2[Router-GigabitEthernet1/2] nat static enable[Router-GigabitEthernet1/2] quit4. 验证配置# 以上配置完成后,内网主机可以访问外网服务器。
通过查看如下显示信息,可以验证以上配置成功。
[Router] display nat staticStatic NAT mappings:There are 1 outbound static NAT mappings.IP-to-IP:Local IP : 10.110.10.8Global IP : 202.38.1.100Interfaces enabled with static NAT:There are 1 interfaces enabled with static NAT.Interface: GigabitEthernet1/2# 通过以下显示命令,可以看到Host访问某外网服务器时生成NAT会话信息。
配置NAT Outbound示例

配置NAT Outbound示例组网需求如图1所示,某公司A区的网络通过AR200-S的地址转换功能访问广域网。
使用公网地址池中的地址(202.169.10.100~202.169.10.200)采用一对一的方式替换A区内部的主机地址(网段为192.168.20.0/24),访问广域网。
B区的网络通过AR200-S的地址转换功能访问广域网。
结合B区的公网IP地址比较少的情况,使用公网地址池(202.169.10.80~202.169.10.83)采用IP地址和端口的替换方式替换B区内部的主机地址(网段为10.0.0.0/24),访问广域网。
其中AR200-S上接口Ethernet2/0/0的公网地址为202.169.10.1/24,对端运营商侧地址为202.169.10.2/24。
图1 配置NAT Outbound组网图配置思路采用如下思路配置NAT Outbound:1.配置接口IP地址。
2.配置缺省路由。
3.在WAN侧接口下配置NAT Outbound,实现内部主机访问外网服务功能。
操作步骤1.在AR200-S上配置接口IP地址。
2.<Huawei> system-view3.[Huawei] vlan 1004.[Huawei-vlan100] quit5.[Huawei] interface vlanif 1006.[Huawei-Vlanif100] ip address 192.168.20.1 247.[Huawei-Vlanif100] quit8.[Huawei] interface Ethernet 0/0/09.[Huawei-Ethernet0/0/0] port link-type access10.[Huawei-Ethernet0/0/0] port default vlan 10011.[Huawei-Ethernet0/0/0] quit12.[Huawei] vlan 20013.[Huawei-vlan200] quit14.[Huawei] interface vlanif 20015.[Huawei-Vlanif200] ip address 10.0.0.1 2416.[Huawei-Vlanif200] quit17.[Huawei] interface Ethernet 0/0/118.[Huawei-Ethernet0/0/1] port link-type access19.[Huawei-Ethernet0/0/1] port default vlan 20020.[Huawei-Ethernet0/0/1] quit21.[Huawei] interface Ethernet 2/0/022.[Huawei-Ethernet2/0/0] ip address 202.169.10.1 2423.[Huawei-Ethernet2/0/0] quit24.在AR200-S上配置缺省路由,指定下一跳地址为202.169.10.2。
华为nat配置实例

窗体顶端NAT【Router】华为路由器单臂路由配置实例组网描述:PC---------------------3050C-------------------------AR28-31-------------------------INTERNET组网实现:3050C上划分多个VLAN,在AR28-31上终结VLAN信息,下面的所有VLAN中的PC都可以上公网,所有的PC机都通过AR28-31分配IP地址和DNS[AR28-31]dis cu#sysname Quidway#FTP server enable#nat address-group 0 222.222.222.2 222.222.222.10用于上公网的地址池#radius scheme system#domain system#local-user adminpasswordcipher .]@USE=B,53Q=^Q`MAF4<1!! service-type telnet terminallevel 3service-type ftplocal-userhuawei telnet用户,用于远程管理password simple huaweiservice-type telnetlevel 3#dhcp server ip-pool 10为VLAN10分配IP地址network 192.168.10.0 mask 255.255.255.0gateway-list 192.168.10.1dns-list 100.100.100.100#dhcp server ip-pool 20为VLAN20分配IP地址network 192.168.20.0 mask 255.255.255.0gateway-list 192.168.20.1dns-list 100.100.100.100#dhcp server ip-pool 30为VLAN30分配IP地址network 192.168.30.0 mask 255.255.255.0gateway-list 192.168.30.1dns-list 100.100.100.100#dhcp server ip-pool 40为VLAN40分配IP地址network 192.168.40.0 mask 255.255.255.0gateway-list 192.168.40.1dns-list 100.100.100.100#interface Aux0async mode flow#interfaceEthernet1/0用于与交换机的管理IP互通ip address 192.168.100.1 255.255.255.0 firewall packet-filter 3000 inbound#interfaceEthernet1/0.1终结交换机上的VLAN10tcp mss 1024ip address 192.168.10.1 255.255.255.0 firewall packet-filter 3000 inbound vlan-type dot1q vid 10#interfaceEthernet1/0.2终结交换机上的VLAN20tcp mss 1024ip address 192.168.20.1 255.255.255.0 firewall packet-filter 3000 inbound vlan-type dot1q vid 20#interfaceEthernet1/0.3终结交换机上的VLAN30tcp mss 1024ip address 192.168.30.1 255.255.255.0 firewall packet-filter 3000 inbound vlan-type dot1q vid 30#interfaceEthernet1/0.4终结交换机上的VLAN40tcp mss 1024ip address 192.168.40.1 255.255.255.0 firewall packet-filter 3000 inbound vlan-type dot1q vid 40#interface Ethernet2/0ip address 222.222.222.1 255.255.255.0 nat outbound 2000 address-group 0进行私网到公网的地址转换#interface NULL0#acl number 2000允许192.168.0.0 这个网段的地址进行地址转换rule 0 permit source 192.168.0.0 0.0.255.255rule 1 deny#acl number 3000rule 0 deny udp destination-port eq tftp rule 1 deny tcp destination-port eq 135 rule 2 deny udp destination-port eq 135 rule 3 deny udp destination-port eq netbios-nsrule 4 deny udp destination-port eq netbios-dgmrule 5 deny tcp destination-port eq 139 rule 6 deny udp destination-port eq netbios-ssnrule 7 deny tcp destination-port eq 445 rule 8 deny udp destination-port eq 445 rule 9 deny tcp destination-port eq 539 rule 10 deny udp destination-port eq 539 rule 11 deny udp destination-port eq 593 rule 12 deny tcp destination-port eq 593 rule 13 deny udp destination-port eq 1434rule 14 deny tcp destination-port eq 4444rule 15 deny tcp destination-port eq 9996rule 16 deny tcp destination-port eq 5554rule 17 deny udp destination-port eq 9996rule 18 deny udp destination-port eq 5554rule 19 deny tcp destination-port eq 137 rule 20 deny tcp destination-port eq 138 rule 21 deny tcp destination-port eq 1025rule 22 deny udp destination-port eq 1025rule 23 deny tcp destination-port eq 9995rule 24 deny udp destination-port eq 9995rule 25 deny tcp destination-port eq 1068rule 26 deny udp destination-port eq 1068rule 27 deny tcp destination-port eq 1023rule 28 deny udp destination-port eq 1023#ip route-static 0.0.0.0 0.0.0.0 222.222.222.254 preference 60到电信网关的缺省路由#user-interface con 0user-interface aux 0user-interface vty 0 4authentication-mode scheme#return===================================== ==========================<Quidway 3050C>dis cu#sysname Quidway#radius scheme systemserver-type huaweiprimary authentication 127.0.0.1 1645 primary accounting 127.0.0.1 1646 user-name-format without-domaindomain systemradius-scheme systemaccess-limit disablestate activevlan-assignment-mode integeridle-cut disableself-service-url disablemessenger time disabledomain default enable system#local-server nas-ip 127.0.0.1 key huaweilocal-user huawei用于WEB网管和TELNETpassword simple huaweiservice-type telnet level 3#vlan 1#vlan 10#vlan 20#vlan 30# vlan 40#interfaceVlan-interface1管理IPip address 192.168.100.2 255.255.255.0 #interface Aux0/0#interface Ethernet0/1port access vlan 10#interface Ethernet0/2port access vlan 10#interface Ethernet0/3port access vlan 10#interface Ethernet0/4port access vlan 10#interface Ethernet0/5port access vlan 10#interface Ethernet0/6port access vlan 10#interface Ethernet0/7port access vlan 10#interface Ethernet0/8port access vlan 10#interface Ethernet0/9port access vlan 10#interface Ethernet0/10port access vlan 10#interface Ethernet0/11port access vlan 20#interface Ethernet0/12port access vlan 20#interface Ethernet0/13 port access vlan 20#interface Ethernet0/14 port access vlan 20#interface Ethernet0/15 port access vlan 20#interface Ethernet0/16 port access vlan 20#interface Ethernet0/17 port access vlan 20#interface Ethernet0/18 port access vlan 20#interface Ethernet0/19 port access vlan 20#interface Ethernet0/20 port access vlan 20#interface Ethernet0/21 port access vlan 30#interface Ethernet0/22 port access vlan 30#interface Ethernet0/23 port access vlan 30#interface Ethernet0/24 port access vlan 30#interface Ethernet0/25 port access vlan 30#interface Ethernet0/26 port access vlan 30# interface Ethernet0/27 port access vlan 30#interface Ethernet0/28 port access vlan 30#interface Ethernet0/29 port access vlan 30#interface Ethernet0/30 port access vlan 30#interface Ethernet0/31 port access vlan 40#interface Ethernet0/32 port access vlan 40#interface Ethernet0/33 port access vlan 40#interface Ethernet0/34 port access vlan 40#interface Ethernet0/35 port access vlan 40#interface Ethernet0/36 port access vlan 40#interface Ethernet0/37 port access vlan 40#interface Ethernet0/38 port access vlan 40#interface Ethernet0/39 port access vlan 40#interface Ethernet0/40 port access vlan 40#interface Ethernet0/41 port access vlan 40 #interface Ethernet0/42port access vlan 40 #interface Ethernet0/43 port access vlan 40 #interface Ethernet0/44 port access vlan 40 #interface Ethernet0/45 port access vlan 40 #interface Ethernet0/46 port access vlan 40 #interface Ethernet0/47 port access vlan 40 #interface Ethernet0/48 上行口port link-type trunkport trunk permit vlan 1 10 20 30 40 只允许这几个VLAN 标签透传 #interface NULL0 #user-interface aux 0 user-interface vty 0 4 #return<Quidway> 0人了章。
配置NAT_Server双出口举例讲解

出口网关双链路接入不同运营商举例一USG作为校园或大型企业出口网关可以实现内网用户通过两个运营商访问Internet,还可以实现外网用户访问内网服务器,并保护内网不受网络攻击。
组网需求某学校网络通过USG连接到Internet,校内组网情况如下:∙校内用户主要分布在教学楼和宿舍区,通过汇聚交换机连接到USG。
图书馆内部署的两台服务器是该校主页、招生及资源共享等网站。
∙学校分别通过两个不同运营商(ISP1和ISP2)连接到Internet,两个运营商分别为该校分配了5个IP地址。
ISP1分配的IP地址是200.1.1.1~200.1.1.5,ISP2分配的IP地址是202.1.1.1~202.1.1.5,掩码均为24位。
该学校网络需要实现以下需求:∙校内用户能够通过两个运营商访问Internet,且去往不同运营商的流量由USG上连接该运营商的对应的接口转发。
∙当一条链路出现故障时,流量可以被及时切换到另一条链路上,避免网络长时间中断。
∙校内用户和校外用户都可以访问图书馆中部署的2台服务器。
∙保护内部网络不受SYN Flood、UDP Flood和ICMP Flood的攻击。
图1 出口网关双链路接入不同运营商举例一组网图项目数据说明(1)接口号:GigabitEthernet 0/0/0IP地址:10.1.1.1/16安全区域:Trust 接口(1)是连接内网汇聚交换机的接口。
校内用户分配到网段为10.1.0.0/16的私网地址和DNS 服务器地址100.1.1.1/24,部署在Trust区域。
(2)接口号:GigabitEthernet 0/0/1IP地址:192.168.1.1/24安全区域:DMZ 接口(2)是连接图书馆内服务器的接口。
图书馆区部署在DMZ区域。
(3)接口号:GigabitEthernet 0/0/2IP地址:200.1.1.1/24安全区域:ISP1安全优先级:15 接口(3)是连接ISP1的接口,去往ISP1所属网段的数据通过接口(3)转发。
华为NAT配置案例

华为NAT配置案例模拟图表1模拟拓扑图1、在华为设备上部署静态NAT技术,实现公司员工(私网)访问internet(公网)静态一对一:AR1#interface GigabitEthernet0/0/1ip address 202.106.1.2 255.255.255.0nat static global 202.1.1.1 inside 192.168.1.2 netmask255.255.255.255AR2#[AR2]ip route-static 202.1.1.1 255.255.255.255 202.106.1.2[AR2]结果测试:查看静态转换表[AR1]display nat staticStatic Nat Information:Interface : GigabitEthernet0/0/1Global IP/Port : 202.1.1.1/----Inside IP/Port : 192.168.1.2/----Protocol : ----VPN instance-name : ----Acl number : ----Netmask : 255.255.255.255Description : ----Total : 1[AR1]在没有做静态NAT条目的PC2上不能访问公网,可以得出结论:静态NAT是静态一对一的关系2、在华为设备上部署动态NAT技术,实现公司员工(私网)访问internet(公网)动态NAT[AR1]nat address-group 1 202.1.1.1 202.1.1.1(定义一个地址池存放一个可用公网地址202.1.1.1)[AR1]dis cu | begin aclacl number 2000 (定义转换的源IP)rule 5 permit source 192.168.1.0 0.0.0.255interface GigabitEthernet0/0/1(接口调用)ip address 202.106.1.2 255.255.255.0nat outbound 2000 address-group 1结果测试:在出接口下将ACL和地址池关联起来,需要注意华为设备上如果地支持中有不止一个IP地址,后面需加no-pat,本例中只有一个地址可以不加;PC1和PC2都可以访问公网[AR1-GigabitEthernet0/0/1]nat outbound 2000 address-group 1 ?no-pat Not use PAT<cr> Please press ENTER to execute command3、在华为设备上部署PAT技术实现公司员工(私网)访问internet(公网)AR1#acl number 2000rule 5 permit source 192.168.1.0 0.0.0.255interface GigabitEthernet0/0/1ip address 202.106.1.2 255.255.255.0nat outbound 2000 (定义复用接口g0/0/1用于PAT转换)结果测试[AR1]dis nat outboundNAT Outbound Information:--------------------------------------------------------------------------Interface Acl Address-group/IP/Interface Type--------------------------------------------------------------------------GigabitEthernet0/0/1 2000 202.106.1.2 easyip--------------------------------------------------------------------------Total : 1[AR1]4、在华为设备上部署静态端口映射技术实现公网用户访问私网服务器静态端口映射--------------------------------------------------------------------------AR1#acl number 2000rule 5 permit source 192.168.1.0 0.0.0.255interface GigabitEthernet0/0/1ip address 202.106.1.2 255.255.255.0nat static protocol tcp global 202.1.1.1 23 inside 192.168.1.4 23 nat outbound 2000#return[AR1-GigabitEthernet0/0/1]--------------------------------------------------------------------------AR3#[AR3]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1[AR3]dis cu | begin vtyuser-interface vty 0 4authentication-mode passwordset authentication password cipher ****user-interface vty 16 20[AR3]。
华为Eudemon防火墙NAT配置实例

[原创]华为Eudemon防火墙NAT配置实例Post By:2007-7-11 11:35:00贴一下我公司里防火墙的配置,希望能够起到抛砖引玉的作用。
具体外网IP和内网ARP绑定信息已经用“x”替代,请根据实际情况更换。
“//”后面的部分是我导出配置后添加的注释。
防火墙型号为华为Eudemon 200,E0/0/0口为外网接口,E0/0/1口为内网。
另外此配置方法也完全适用于华为Secpath系列防火墙,略加改动也可适用于华为AR系列路由器。
------------------------------------------传说中的分隔线------------------------------------------#sysname Eudemon//设置主机名#super password level 3 simple xxxxxxxx//Super密码为xxxxxxxx #firewall packet-filter default permit interzone local trust direction inboundfirewall packet-filter default permit interzone local trust direction outboundfirewall packet-filter default permit interzone local untrust direction inboundfirewall packet-filter default permit interzone local untrust direction outboundfirewall packet-filter default permit interzone local dmz direction inboundfirewall packet-filter default permit interzone local dmz direction outboundfirewall packet-filter default permit interzone trust untrust direction inboundfirewall packet-filter default permit interzone trust untrust direction outboundfirewall packet-filter default permit interzone trust dmz direction inboundfirewall packet-filter default permit interzone trust dmz direction outboundfirewall packet-filter default permit interzone dmz untrust direction inboundfirewall packet-filter default permit interzone dmz untrust direction outbound//设置默认允许所有数据包通过#青岛IT社区提醒:本地交易眼见为实,当面验货!不要嫌麻烦!交易地点建议在人多地方,防止抢劫!QQ:支持(0) 中立(0) 反对(0)wanghaoqd 小大 2楼个性首页| QQ| 信息| 搜索| 邮箱| 主页| 手机号码所在地查询|加好友发短信蛋白超人等级:退役版主帖子:206 7积分:185 威望:5精华:1 注册:2004-3-24Post By:2007-7-11 11:35:00nat address-group 1 //将ISP分配的公网IP加入地址池1nat server global insidenat server global insidenat server global insidenat server global insidenat server global inside //将几个公网IP地址映射到内部服务器nat alg enable ftpnat alg enable dnsnat alg enable icmpnat alg enable netbiosundo nat alg enable h323undo nat alg enable hwccundo nat alg enable ilsundo nat alg enable pptpundo nat alg enable qqundo nat alg enable msnundo nat alg enable user-defineundo nat alg enable rtspfirewall permit sub-ip#firewall statistic system enable#interface Aux0async mode flowlink-protocol ppp#interface Ethernet0/0/0ip address //设置外网端口IP地址,此处为网通分配的内部私有IP,#interface Ethernet0/0/1ip address //设置内网IP地址,采用#interface NULL0#acl number 2000rule 0 permit source //ACL 2000,目的是只允许rule 1 deny#acl number 3001rule 0 deny udp destination-port eq 445rule 1 deny udp destination-port eq netbios-nsrule 2 deny udp destination-port eq netbios-dgmrule 3 deny udp destination-port eq netbios-ssnrule 4 deny udp destination-port eq 1434rule 5 deny tcp destination-port eq 135rule 6 deny tcp destination-port eq 139rule 7 deny tcp destination-port eq 389rule 8 deny tcp destination-port eq 445rule 9 deny tcp destination-port eq 636rule 10 deny tcp destination-port eq 1025rule 11 deny tcp destination-port eq 1503rule 12 deny tcp destination-port eq 3268rule 13 deny tcp destination-port eq 3269rule 14 deny tcp destination-port eq 4444rule 15 deny tcp destination-port eq 5554rule 16 deny tcp destination-port eq 5800rule 17 deny tcp destination-port eq 5900rule 18 deny tcp destination-port eq 9996rule 19 deny tcp destination-port eq 6667//ACL 300 1,关闭常见蠕虫病毒使用的端口#firewall zone localset priority 100QQ:支持(0) 中立(0) 反对(0)wanghaoqd 小大 3楼个性首页| QQ| 信息| 搜索| 邮箱| 主页| 手机号码所在地查询|加好友发短信蛋白超人等级:退役版主帖子:206 7积分:185 威望:5精华:1 注册:2004-3-24Post By:2007-7-11 11:36:00#firewall zone trustset priority 85add interface Ethernet0/0/1//将E0/ 0/1口加入TRUST区#firewall zone untrustset priority 5add interface Ethernet0/0/0 //将E0/0/0口加入UN TRUST区#firewall zone dmzset priority 50#firewall interzone local trustpacket-filter 3001 inbound//在LO CAL到TRUST方向应用ACL 3001号#firewall interzone local untrustpacket-filter 3001 inbound//在LO CAL到UNTRUST方向应用ACL 3001号#firewall interzone local dmz#firewall interzone trust untrustnat outbound 2000 address-group 1 //在TRUST到U NTRUST的方向做NAT,使用2000号ACL#firewall interzone trust dmz#firewall interzone dmz untrust#aaalocal-user admin password cipher A^.5<+_KCH)./a!1$H@GYA!!//建立用户admin,密码为密文local-user admin level 3 //用户权限为3(最高级)authentication-scheme default#authorization-scheme default#accounting-scheme default#domain default##arp static xxxx-xxxx-xxxx//做IP和MAC地址绑定arp static xxxx-xxxx-xxxxarp static xxxx-xxxx-xxxxarp static xxxx-xxxx-xxxxarp static xxxx-xxxx-xxxxarp static xxxx-xxxx-xxxx…………………………//省略许多行......arp static 1111-1111-1111arp static 1111-1111-1111arp static 1111-1111-1111arp static 1111-1111-1111arp static 1111-1111-1111//把不使用的IP与不存在的#ip route-static //设置缺省路由,此处IP地址为网通内部IP,#snmp-agentsnmp-agent local-engineid 000007DB7F00000Dsnmp-agent community read xxxxxxsnmp-agent community write xxxxxxsnmp-agent sys-info version all//设置SNMP参数,以使用网管软件来监控#user-interface con 0user-interface aux 0user-interface vty 0 4authentication-mode aaa//设置VTY口的认证模式为AAA#returnQQ:支持(0) 中立(0) 反对(0) pladin123小大 4楼个性首页| 信息| 搜索| 邮箱| 主页| 手机号码所在地查询|加好友发短信等级:QDIT游民帖子:23 8积分:1309 威望:0 精华:0 注册:2007-3-30 16:0 4:00Post By:2007-7-23 13:12:00楼上的这种方法带宽方面的如何的呢?内网所有都用一个IP,那不是浪费了吗还有我们和美国视频会议的时候,会不会有影响。
h3c 路由器nat配置

假设Ethernet0/0为局域网接口,Ethernet0/1为外网口。
1、配置内网接口(Ethernet0/0):[MSR20-20] interface Ethernet0/0[MSR20-20- Ethernet0/0]ip add 192.168.1.1 242、使用动态分配地址的方式为局域网中的PC分配地址[MSR20-20]dhcp server ip-pool 1[MSR20-20-dhcp-pool-1]network 192.168.1.0 24[MSR20-20-dhcp-pool-1]dns-list 202.96.134.133[MSR20-20-dhcp-pool-1] gateway-list 192.168.1.13、配置nat[MSR20-20]nat address-group 1 公网IP 公网IP[MSR20-20]acl number 3000[MSR20-20-acl-adv-3000]rule 0 permit ip4、配置外网接口(Ethernet0/1)[MSR20-20] interface Ethernet0/1[MSR20-20- Ethernet0/1]ip add 公网IP[MSR20-20- Ethernet0/1] nat outbound 3000 address-group 15.加默缺省路由[MSR20-20]route-stac 0.0.0.0 0.0.0.0 外网网关总结:在2020路由器下面,配置外网口,配置内网口,配置acl 作nat,一条默认路由指向电信网关. ok!Console登陆认证功能的配置一、组网需求:要求用户从console登录时输入已配置的用户名h3c和对应的口令h3c,用户名和口令正确才能登录成功。
二、组网图:三、配置步骤:设备和版本:MSR系列、version 5.20, R1508P02:1) 在配置完成后,释放当前连接,重新连接设备即可。
防火墙拨号上网

ip user-based-sharing enable
quit
三、配置拨号口2 (如果是单线路拨号上网,那么请忽略此部分配置)
interface Dialer11
nat outbound
link-protocol ppp
ppp chap user XXX
zone name Trust
import interface GigabitEthernet0/2
quit
zone name Untrust id 4
import interface GigabitEthernet0/1
quit
十、保存配置
save
quit
五、配置dhcp地址池:
dhcp server ip-pool vlan1
network ip range 192.168.1.2 192.168.1.254
network mask 255.255.255.0
expired day 1 hour 5
gateway-list 192.168.1.1
nat outbound
pppoe-client dial-bundle-number 11
quit
六、配置上网路由
ip route-static 0.0.0.0 0.0.0.0 Dialer11
七、开启dns代理,开启dhcp
dns proxy enable
ppp pap local-user XXX password simple XXX
ppp ipcp dns admit-any
ppp ipcp dns request
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
配置NAT Outbound示例
组网需求
如图1所示,某公司A区的网络通过AR200-S的地址转换功能访问广域网。
使用公网地址池中的地址(202.169.10.100~202.169.10.200)采用一对一的方式替换A区内部的主机地址(网段为192.168.20.0/24),访问广域网。
B区的网络通过AR200-S的地址转换功能访问广域网。
结合B区的公网IP地址比较少的情况,使用公网地址池(202.169.10.80~202.169.10.83)采用IP地址和端口的替换方式替换B区内部的主机地址(网段为10.0.0.0/24),访问广域网。
其中AR200-S上接口Ethernet2/0/0的公网地址为202.169.10.1/24,对端运营商侧地址为202.169.10.2/24。
图1 配置NAT Outbound组网图
配置思路
采用如下思路配置NAT Outbound:
1.配置接口IP地址。
2.配置缺省路由。
3.在WAN侧接口下配置NAT Outbound,实现内部主机访问外网服务功能。
操作步骤
1.在AR200-S上配置接口IP地址。
2.<Huawei> system-view
3.[Huawei] vlan 100
4.[Huawei-vlan100] quit
5.[Huawei] interface vlanif 100
6.[Huawei-Vlanif100] ip address 192.168.20.1 24
7.[Huawei-Vlanif100] quit
8.[Huawei] interface Ethernet 0/0/0
9.[Huawei-Ethernet0/0/0] port link-type access
10.[Huawei-Ethernet0/0/0] port default vlan 100
11.[Huawei-Ethernet0/0/0] quit
12.[Huawei] vlan 200
13.[Huawei-vlan200] quit
14.[Huawei] interface vlanif 200
15.[Huawei-Vlanif200] ip address 10.0.0.1 24
16.[Huawei-Vlanif200] quit
17.[Huawei] interface Ethernet 0/0/1
18.[Huawei-Ethernet0/0/1] port link-type access
19.[Huawei-Ethernet0/0/1] port default vlan 200
20.[Huawei-Ethernet0/0/1] quit
21.[Huawei] interface Ethernet 2/0/0
22.[Huawei-Ethernet2/0/0] ip address 202.169.10.1 24
23.[Huawei-Ethernet2/0/0] quit
24.在AR200-S上配置缺省路由,指定下一跳地址为202.169.10.2。
25.[Huawei] ip route-static 0.0.0.0 0.0.0.0 202.169.10.2
26.在AR200-S上配置NAT Outbound。
27.[Huawei] nat address-group 1 202.169.10.100 202.169.10.200
28.[Huawei] nat address-group 2 202.169.10.80 202.169.10.83
29.[Huawei] acl 2000
30.[Huawei-acl-basic-2000] rule 5 permit source 192.168.20.0 0.0.0.255
31.[Huawei-acl-basic-2000] quit
32.[Huawei] acl 2001
33.[Huawei-acl-basic-2001] rule 5 permit source 10.0.0.0 0.0.0.255
34.[Huawei-acl-basic-2001] quit
35.[Huawei] interface Ethernet 2/0/0
36.[Huawei-Ethernet2/0/0] nat outbound 2000 address-group 1 no-pat
37.[Huawei-Ethernet2/0/0] nat outbound 2001 address-group 2
38.[Huawei-Ethernet2/0/0] quit
39.检查配置结果。
在AR200-S上执行display nat outbound操作,结果如下。
[Huawei] display nat outbound
NAT Outbound Information:
-----------------------------------------------------------------
Interface Acl Address-group/IP/Interface
Type
-----------------------------------------------------------------
Ethernet2/0/0 2000 1 no-pat
Ethernet2/0/0 2001 2 pat
-----------------------------------------------------------------
Total : 2
在AR200-S上执行如下操作:
<Huawei> ping -a 192.168.20.1 202.169.10.2
PING 202.169.10.2: 56 data bytes, press CTRL_C to break Reply from 202.169.10.2: bytes=56 Sequence=1 ttl=255 time=1 ms Reply from 202.169.10.2: bytes=56 Sequence=2 ttl=255 time=1 ms Reply from 202.169.10.2: bytes=56 Sequence=3 ttl=255 time=1 ms Reply from 202.169.10.2: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 202.169.10.2: bytes=56 Sequence=5 ttl=255 time=1 ms
<Huawei> ping -a 10.0.0.1 202.169.10.2
PING 202.169.10.2: 56 data bytes, press CTRL_C to break
Reply from 202.169.10.2: bytes=56 Sequence=1 ttl=255 time=1 ms
Reply from 202.169.10.2: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 202.169.10.2: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 202.169.10.2: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 202.169.10.2: bytes=56 Sequence=5 ttl=255 time=1 ms
配置文件
#
vlan batch 100 200
#
acl number 2000
rule 5 permit source 192.168.20.0 0.0.0.255
#
acl number 2001
rule 5 permit source 10.0.0.0 0.0.0.255 #
interface Vlanif100
ip address 192.168.20.1 255.255.255.0
#
interface Vlanif200
ip address 10.0.0.1 255.255.255.0
#
interface Ethernet0/0/0
port link-type access
port default vlan 100
#
interface Ethernet0/0/1
port link-type access
port default vlan 200 #
interface Ethernet2/0/0
ip address 202.169.10.1 255.255.255.0
nat outbound 2000 address-group 1 no-pat
nat outbound 2001 address-group 2
#
nat address-group 1 202.169.10.100 202.169.10.200
nat address-group 2 202.169.10.80 202.169.10.83 #
ip route-static 0.0.0.0 0.0.0.0 Ethernet 2/0/0
#
return。