发布网友
共2个回答
热心网友
第一步,配置内网的ip地址
第二步,配置*的IP地址
第三步,配置一个ACL 包含容许上网的IP网段
第四步,配置NAT,把ACL翻译到*端口,并使用超载。
HXrouter#show run
Building configuration...
Current configuration : 1503 bytes
!
! Last configuration change at 07:41:21 UTC Sat Mar 21 2015 by hailong
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname HXrouter
!
boot-start-marker
boot-end-marker
!
no aaa new-model
ip cef
!
no ip domain lookup
no ipv6 cef
ipv6 multicast rpf use-bgp
!
multilink bundle-name authenticated
!
username hailong privilege 15 password 0 hailong
username cisco privilege 15 password 0 cisco
!
tEthernet0/1
no ip address
media-type rj45
speed auto
plex auto
negotiation auto
!
interface GigabitEthernet0/2
description *CNC1*
ip address 220.33.76.19 255.255.255.248
ip nat outside
media-type rj45
speed auto
plex auto
negotiation auto
!
interface GigabitEthernet0/3
ip address 10.10.2.1 255.255.255.0
ip nat inside
media-type rj45
speed auto
plex auto
negotiation auto
!
ip nat inside source list nat interface GigabitEthernet0/2 overload
ip nat inside source static tcp 192.168.2.104 9080 220.33.76.19 9080 extendable
ip forward-protocol nd
ip http server
no ip http secure-server
!
!
ip route 0.0.0.0 0.0.0.0 220.33.76.17
ip route 192.168.0.0 255.255.0.0 10.10.2.254
!
ip access-list extended nat
permit ip any any
!
!
!
!
control-plane
!
!
line con 0
stopbits 1
line aux 0
stopbits 1
line vty 0 4
login local
!
!
end
热心网友
配置ACL
access-list 1 permit 192.168.0.0 0.0.0.255
配置NAT
ip nat inside source list 1 int XX overload
这里的int XX,是本地出口路由器与运营商连接的端口
指定outside
int xx
ip nat outside
这里的XX同上
指定inside
int yy
ip nat inside
这里的YY接口,是下联PC或LAN的接口(PC网关)