直接做NAT
Router#show running-config
Building configuration...
Current configuration : 875 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
ip cef
no ipv6 cef
!
!
license udi pid CISCO2911/K9 sn FTX1524U38X-
!
no ip domain-lookup
!
spanning-tree mode pvst
!
interface GigabitEthernet0/0 ip address 192.168.1.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface GigabitEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface GigabitEthernet0/2 ip address 100.1.1.1 255.255.255.0
ip nat outside
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
! ip nat inside source list 1 interface GigabitEthernet0/2 overload
ip classless
!
ip flow-export version 9
! access-list 1 permit 192.168.1.0 0.0.0.255
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
end
Router#show running-config
Building configuration...
Current configuration : 904 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
ip cef
no ipv6 cef
!
license udi pid CISCO2911/K9 sn FTX1524U38X-
!
no ip domain-lookup
!
spanning-tree mode pvst
! interface GigabitEthernet0/0 ip address 192.168.1.1 255.255.255.0 ip nat inside duplex auto speed auto
!
interface GigabitEthernet0/1
no ip address
duplex auto
speed auto
shutdown
! interface GigabitEthernet0/2 ip address 100.1.1.1 255.255.255.0 ip nat outside duplex auto speed auto
!
interface Vlan1
no ip address
shutdown
! ip nat inside source list 1 interface GigabitEthernet0/2 overload ip default-gateway 100.1.1.2
ip classless
!
ip flow-export version 9
! access-list 1 permit 192.168.1.0 0.0.0.255
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
end