配置通过NAT访问Internet外网,并对外提供www服务的示例(NAT)

组网需求

内网用户通过路由器的NAT地址转换功能来访问Internet,并且向外网用户提供www服务。

1、拓扑图

image

2、配置说明

用于转换的外网地址,不能用于其他的NAT中。

3、配置文件

#
acl number 2000
 rule 5 permit source 192.168.1.0 0.0.0.255 #
#
 nat address-group 1 218.246.109.101 218.246.109.200
#
interface GigabitEthernet0/0/0
 ip address 218.246.109.100 255.255.255.0
 nat static protocol tcp global 218.246.109.222 www inside 192.168.1.100 www netmask 255.255.255.255
 nat outbound 2000 address-group 1
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
 ip address 192.168.1.254 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 218.246.109.233

查看配置

[AR2]dis nat static
  Static Nat Information:
  Interface  : GigabitEthernet0/0/0
    Global IP/Port     : 218.246.109.222/80(www)
    Inside IP/Port     : 192.168.1.100/80(www)
    Protocol : 6(tcp)
    VPN instance-name  : ----
    Acl number         : ----
    Netmask  : 255.255.255.255
    Description : ----

  Total :    1
[AR2]

4、测试结果

image


读书和健身总有一个在路上

posted @ 2020-09-17 12:41  Renqy  阅读(1501)  评论(0编辑  收藏  举报