搜档网
当前位置:搜档网 › CISCO路由器NAT功能的配置案例

CISCO路由器NAT功能的配置案例

1.静态地址转换

静态地址转换将内部本地地址与内部合法地址进行一对一地转换,且需要指定和哪个合法地址进行转换。如果内部网络有WWW服务器或FTP服务器等可以为外部用户提供服务,则这些服务器的IP地址必须采用静态地址转换,以便外部用户可以使用这些服务。

2.动态地址转换

动态地址转换也是将内部本地地址与内部合法地址一对一地转换,但是动态地址转换是从内部合法地址池中动态地选择一个未使用的地址来对内部本地地址进行转换的。

3.复用动态地址转换

复用动态地址转换首先是一种动态地址转换,但是它可以允许多个内部本地地址共用一个内部合法地址。对只申请到少量IP地址但却经常同时有多个用户上外部网络的情况,这种转换极为有用。

PAT(Port Address Translation)也称为NAPT,就是将多个内部地址映射为一个公网地址,但以不同的协议端口号与不同的内部地址相对应。这种方式常用于拨号上Internet网。

以下是以2611路由器为例,配置清单如下: Current configuration:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname 2611
!
enable secret 5 $JIeG$UZJNjKhcptJXHPc/BP5GG0
enable password 2323ipro
!
ip subnet-zero
no ip source-route
no ip finger
!
!
!
interface Ethernet0/0
ip address 192.168.10.254 255.255.255.0 secondary
ip address 218.27.84.249 255.255.255.248
no ip directed-broadcast
ip accounting output-packets
no ip mroute-cache
no cdp enable
!
interface Serial0/0
ip unnumbered Ethernet0/0
no ip directed-broadcast
ip accounting output-packets
ip nat outside
no ip mroute-cache
no fair-queue
no cdp enable
!
interface Ethernet0/1
ip address 192.168.2.254 255.255.255.0
no ip directed-broadcast
ip nat inside
no ip mroute-cache
no cdp enable
!

interface Virtual-TokenRing35
no ip address
no ip directed-broadcast
no ip mroute-cache
shutdown
ring-speed 16
!
router rip
redistribute connected
network 192.168.2.0
network 192.168.10.0
network 218.27.84.0
!
ip default-gateway 218.27.127.217
ip nat pool nat-pool 218.27.84.252 218.27.84.254 netmask 255.255.255.248
ip nat inside source list 1 pool nat-pool overload
ip nat inside source static 192.168.2.254 218.27.84.249
ip classless
ip route 0.0.0.0

0.0.0.0 Serial0/0
ip http server
ip http port 9091
ip ospf name-lookup
!
!
ip access-list extended filterin
permit tcp any host 218.27.84.249 eq www reflect httpfilter
access-list 1 permit 192.168.2.0 0.0.0.255
no cdp run
!
line con 0
transport input none
line aux 0
line vty 0 4
password routr
login
!
end

相关主题