要求:将192.168.0.0 255.255.255.0的内网地址转换成10.8.3.254的外网地址上网,要求内网地址自动获得。
Building configuration...
Current configuration : 1039 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
service password-encryption
!
hostname CAIHONG7400
!
logging snmp-authfail
logging queue-limit 100
enable secret 5 $1$kDlJ$LeiJIraxm2s68rZM7jqOk1
!
username nbip password 7 00554155500E5D
ip subnet-zero
ip cef
!
!
!
ip dhcp pool CH7400 /*定义一个地址池,名字为CH7400*/
network 192.168.0.0 255.255.255.0 /*定义地址池里用做地址分配的地址*/
default-router 192.168.0.2 /*配置主机的默认网关192.168.0.2*/
dns-server 10.8.1.41 10.8.1.101 /*配置主机的DNS服务器地址*/
!
call rsvp-sync
!
!
!
!
!
!
!
!
interface GigabitEthernet0/0
ip address 10.8.3.134 255.255.255.0
ip nat outside /*定义该端口为外口*/
duplex auto
speed auto
media-type rj45
no negotiation auto
!
interface GigabitEthernet0/1
ip address 192.168.0.2 255.255.255.0
ip nat inside /*定义该端口为内口*/
duplex auto
speed auto
media-type rj45
no negotiation auto
!
ip nat inside source list 10 interface GigabitEthernet0/0 overload /*将列表10的地址与端口g0/0进行转换*/
ip classless
ip route 0.0.0.0 0.0.0.0 10.8.3.254
no ip http server
!
!
access-list 10 permit 192.168.0.0 0.0.0.255 /*建立访问列表10允许192.168.0.0 0.0.0.255网段地址被转换*/
!
!
dial-peer cor custom
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
line aux 0
line vty 0 4
login local
!
end |
|