Saturday, September 15, 2007

How about multiple internet connections?

Lets presume that one of your customers is buying two internet connections. One is from you, the other one is from the competition. Since he is not buying alot of bandwidth, he won't have much options regarding the usage of bgp, or some other routing protocol to switch between providers when one of his links is down. Here's a quick solution:

PS: this was a cisco 851

no service pad
service timestamps debug uptime
service timestamps log uptime
service password-encryption
!
hostname example-customer
!
boot-start-marker
boot-end-marker
!
logging buffered 65535 debugging
!
aaa new-model
!
!
aaa authentication password-prompt password:
aaa authentication username-prompt Username:
aaa authentication login default local
aaa authorization exec default local
!
aaa session-id common
!
resource policy
!
clock timezone GMT+1 1
ip subnet-zero
no ip source-route
ip cef
!
!
no ip dhcp use vrf connected
!
ip dhcp pool example-customer
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
dns-server
domain-name example-customer.com
lease 2
!
!
ip tcp path-mtu-discovery
no ip bootp server
ip domain name example-customer.com
ip name-server
ip name-server
ip sla 1
icmp-echo source-ip
request-data-size 500
threshold 2000
tag providers-rtr
frequency 45
ip sla schedule 1 start-time now
ip sla 2
icmp-echo source-ip
request-data-size 500
threshold 3000
tag providers-rtr
frequency 45
ip sla schedule 2 start-time now
!
!
!
!
!
!
track 1 rtr 1
!
track 2 rtr 2
!
!
!
!
!
interface FastEthernet0
description Link to Provider1
switchport access vlan 2
spanning-tree portfast
!
interface FastEthernet1
description Link to Provider2
switchport access vlan 3
spanning-tree portfast
!
interface FastEthernet2
!
interface FastEthernet3
!
interface FastEthernet4
description Local LAN
ip address 192.168.2.1 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface Vlan1
no ip address
!
interface Vlan2
description Link to Provider1
ip address 255.255.255.248
ip nat outside
ip virtual-reassembly
!
interface Vlan3
description Link to Provider2
ip address 255.255.255.248
ip nat outside
ip virtual-reassembly
!
ip classless
ip route 0.0.0.0 0.0.0.0 track 1
ip route 0.0.0.0 0.0.0.0 10 track 2
!
no ip http server
no ip http secure-server
ip nat pool provider1 prefix-length 29
ip nat pool provider2 prefix-length 29
ip nat inside source route-map nat-provider1-out pool provider1 overload
ip nat inside source route-map nat-provider2-out pool provider2 overload
!
access-list 10 permit 192.168.0.0 0.0.0.255
access-list 11 permit
access-list 12 permit
access-list 20 permit 192.168.2.0 0.0.0.255

no cdp run
!
route-map nat-provider1-out permit 10
match ip next-hop 12
!
route-map nat-provider2-out permit 10
match ip next-hop 11
!
!
control-plane
!
banner motd ^C
welcome dude.
^C
!
line con 0
exec-timeout 30 0
no modem enable
line aux 0
line vty 0 4
access-class 160 in
exec-timeout 30 0
transport input telnet ssh
transport output telnet ssh
!
scheduler max-task-time 5000
end

I took out some parts of the config and changed it a bit from what it looks like on the router, but it should work without problems.

0 comments: