赞
踩
Easy IP方式直接使用出接口的IP地址作为内网主机转换后的外网IP地址,无需额外的外网IP地址。(华为特有)
配置注意事项
● 配置ACL,确定对哪些网段进行NAT转换。
● 在出接口视图下配置NAT转换,注意转换方向。
LSW1
#
undo info-center enable 不开信息提示
#
vlan batch 10 20 30 100 to 101
#
interface Vlanif10
ip address 192.168.10.254 255.255.255.0
#
interface Vlanif20
ip address 192.168.20.254 255.255.255.0
#
interface Vlanif30
ip address 192.168.30.1 255.255.255.0
#
interface Vlanif100
ip address 10.0.100.254 255.255.255.0
#
interface Vlanif101
ip address 10.0.101.254 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/4
port link-type access
port default vlan 100
#
interface GigabitEthernet0/0/5
port link-type access
port default vlan 101
#
interface GigabitEthernet0/0/6
port link-type access
port default vlan 10
#
#
ip route-static 0.0.0.0 0.0.0.0 192.168.30.2 配置出口的静态路由
AR1
#
acl number 2000
rule 5 permit source 192.168.0.0 0.0.255.255 //从上而下,匹配就不往下走了
rule 10 permit source 10.0.0.0 0.0.255.255
#
interface GigabitEthernet0/0/0
ip address 192.168.30.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 1.1.1.1 255.255.255.0
nat server protocol tcp global 1.1.1.3 8080 inside 10.0.100.1 www //实现对内网服务器的访问 ,把公网地址(加端口)1.1.1.3 8080 映射到 10.0.100.1 80 上。
nat outbound 2000 // easy ip ,用接口的地址做端口转换
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 1.1.1.2
ip route-static 10.0.0.0 255.255.0.0 192.168.30.1
ip route-static 192.168.0.0 255.255.0.0 192.168.30.1
#
AR2
#
interface GigabitEthernet0/0/0
ip address 1.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 2.2.2.2 255.255.255.0
错误点:
1、静态路由写错,10.0.100.1 写成10.100.0.1
2、静态路由没有配全,随时dis ip route table,看是否缺路由。
3、外部的客户机访问,需要写公网的地址和端口。
4、内网访问用内部地址
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。