Mô hình Lab như sau.
Đề bài: Cấu hình Routing và Nat sao cho mạng 192.168.1.0/24 được Pat thành IP 203.162.4.3 trên Router 2. Tiếp tục cấu hình Pat trên Router 4 để có mạng 192.168.1.0/24 có thể đi ra môi trường internet thật được
- File cấu hình của router 1 như sau
sh run full
Building configuration...
Current configuration : 1184 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
!
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0 secondary
ip address 192.168.1.3 255.255.255.0 secondary
ip address 192.168.1.4 255.255.255.0 secondary
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial2/0
ip address 192.1.12.1 255.255.255.0
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
--More--
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
!
router eigrp 10
network 192.1.12.0
network 192.168.1.0
no auto-summary
!
ip forward-protocol nd
!
!
ip http server
no ip http secure-server
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end
R1#
- File cấu hình của router 2 như sau
sh run full
Building configuration...
Current configuration : 1448 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
--More-- !
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
--More-- !
interface Loopback0
ip address 203.162.4.1 255.255.255.248
!
interface FastEthernet0/0
ip address 10.0.0.2 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial2/0
ip address 192.1.12.2 255.255.255.0
ip nat inside
ip virtual-reassembly
no fair-queue
serial restart-delay 0
--More--
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
!
router eigrp 10
network 10.0.0.0
network 192.1.12.0
network 203.162.4.0
no auto-summary
!
ip default-network 10.0.0.0
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.0.0.3
!
!
ip http server
no ip http secure-server
ip nat pool net203 203.162.4.3 203.162.4.3 netmask 255.255.255.248
ip nat inside source list 1 pool net203 overload
!
access-list 1 permit 192.168.1.0 0.0.0.255
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
line aux 0
line vty 0 4
!
!
end
R2#
- File cấu hình Router 3
sh run full
Building configuration...
Current configuration : 1233 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
--More--
!
!
!
--More--
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
ip address 10.0.0.3 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial2/0
ip address 192.1.23.1 255.255.255.252
no fair-queue
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
!
router ospf 1
log-adjacency-changes
redistribute static subnets
network 3.3.3.3 0.0.0.0 area 0
network 192.1.23.0 0.0.0.3 area 0
!
ip forward-protocol nd
ip route 203.162.4.0 255.255.255.248 10.0.0.2
!
!
ip http server
no ip http secure-server
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
line aux 0
line vty 0 4
!
--More--
end
R3#
- File cấu hình router 4
sh run full
Building configuration...
Current configuration : 1402 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
ip name-server 203.113.131.1
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns
!
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface FastEthernet0/0
ip address dhcp
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial2/0
ip address 192.1.23.2 255.255.255.252
ip nat inside
ip virtual-reassembly
no fair-queue
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
!
router ospf 1
log-adjacency-changes
network 4.4.4.4 0.0.0.0 area 0
network 192.1.23.0 0.0.0.3 area 0
default-information originate
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 192.168.3.254
!
!
ip http server
no ip http secure-server
ip nat inside source list 1 interface FastEthernet0/0 overload
!
access-list 1 permit 203.162.4.0 0.0.0.7
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end
R4#