Задача состояла в следующем: Есть 3640. Двумя серийниками s2/0 и s2/1 подключена к разным провайдерам. Каждый провайдер предоставил по блоку адресов, первый 10.0.0.0/24 - второй 10.0.1.0/24. Каждый зи них роутит только свою сетку. Нужно обеспечить доступ локальной сети в internet как, чтобы хоcты с адресами из блока первого провайдера ходили через ISP1, а с адресами из блока второго провайдера - через ISP2. При падении одного из каналов хосты должны ходить через работающий канал. Предложено решение: использовать Policy Routing + NAT
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname RouterC
!
enable secret 5 *****
!
ip subnet-zero
no ip domain-lookup
!
cns event-service server
!
voice-port 1/0/0
!
voice-port 1/0/1
!
voice-port 1/1/0
!
voice-port 1/1/1
!
interface Loopback0
ip address 10.0.3.1 255.255.255.0
no ip directed-broadcast
!
interface Ethernet0/0
ip address 10.0.0.1 255.255.255.0
ip address 10.0.1.1 255.255.255.0 secondary
no ip directed-broadcast
ip nat inside
ip policy route-map ISP
!
interface Serial0/0
no ip address
no ip directed-broadcast
no ip mroute-cache
shutdown
!
interface Serial0/1
no ip address
no ip directed-broadcast
shutdown
!
interface Serial2/0
ip address 192.168.0.6 255.255.255.252
no ip directed-broadcast
ip nat outside
!
interface Serial2/1
ip address 192.168.0.10 255.255.255.252
no ip directed-broadcast
ip nat outside
!
interface Serial2/2
no ip address
no ip directed-broadcast
shutdown
!
interface Serial2/3
no ip address
no ip directed-broadcast
shutdown
!
ip nat pool ISP1-pool 10.0.0.16 10.0.0.31 prefix-length 28
ip nat pool ISP2-pool 10.0.1.16 10.0.1.31 prefix-length 28
ip nat inside source route-map ISP1-NAT pool ISP1-pool overload
ip nat inside source route-map ISP2-NAT pool ISP2-pool overload
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.0.5
ip route 0.0.0.0 0.0.0.0 192.168.0.9
no ip http server
!
access-list 1 permit 10.0.0.0 0.0.0.255
access-list 2 permit 10.0.1.0 0.0.0.255
access-list 100 permit ip 10.0.1.0 0.0.0.255 10.0.0.0 0.0.0.255
access-list 100 permit ip 10.0.0.0 0.0.0.255 10.0.1.0 0.0.0.255
route-map ISP1-NAT permit 10
match ip address 2
match interface Serial2/0
!
route-map ISP2-NAT permit 10
match ip address 1
match interface Serial2/1
!
route-map ISP deny 10
match ip address 100
!
route-map ISP permit 20
match ip address 1
set ip next-hop 192.168.0.5
!
route-map ISP permit 30
match ip address 2
set ip next-hop 192.168.0.9
!
snmp-server engineID local 000000090200003094A41BC1
!
line con 0
transport input none
line aux 0
no exec
transport input all
line vty 0 4
exec-timeout 0 0
password *****
login
!
end
|