Topology
SanJose
!
!Step 0: Basic Setting
conf t
hostname SanJose
no ip domain-lookup
end
!
!Step 1: Assign IP Addresses
conf t
int s 0/0
ip add 10.0.0.2 255.255.255.252
no sh
int s 0/1
ip add 172.16.0.2 255.255.255.252
no sh
int lo0
ip add 192.168.0.1 255.255.255.0
no sh
int lo1
ip add 192.168.1.1 255.255.255.0
no sh
end
!
!Step 3: Configure SanJose BGP
conf t
router bgp 100
neighbor 10.0.0.1 remote-as 200
neighbor 172.16.0.1 remote-as 300
network 192.168.0.0
network 192.168.1.0
end
!
!Step 4: Verify BGP on the SanJose Router
show ip bgp
!
!針對ISP1的lo0介面做shutdown
show ip bgp
show ip bgp neighbor
!
!Step 5: Filter Routes
conf t
access-list 192.168.0.0 0.0.1.255
end
!
conf t
router bgp 100
neighbor 10.0.0.1 distribute-list 1 out
neighbor 172.16.0.1 distribute-list 1 out
end
!
!Hardware Update BGP Session Out
clear ip bgp *
!
!Soft Update BGP Session Out
clear ip bgp 100 soft out
!
!Step 6: Configure the Primary and Backup Routes Using Floating Static Routes
conf t
ip route 0.0.0.0 0.0.0.0 10.0.0.1 210
ip route 0.0.0.0 0.0.0.0 172.16.0.1 220
end
!啟用extend ping (TargetIP 210.210.210.1, SourceIP 192.168.1.1)
ping
!
!Step 7: Configure Primary and Backup Routes Using Static Routes
conf t
no ip route 0.0.0.0 0.0.0.0 10.0.0.1 210
no ip route 0.0.0.0 0.0.0.0 172.16.0.1 220
end
!
!使用ip default-network指令來送出Default Gateway(Primary)
conf t
ip default-network 210.210.210.0
end
!設定Backup default route至172.16.0.1(Secondary)
conf t
ip route 0.0.0.0 0.0.0.0 172.16.0.1 220
end
ISP1
!
!Step 0: Basic Setting
conf t
hostname ISP1
no ip domain-lookup
end
!
!Step 1: Assign IP Addresses
conf t
int s 0/0
ip add 10.0.0.1 255.255.255.252
no sh
int lo0
ip add 12.0.1.1 255.255.255.0
no sh
end
!
!Step 2: Configure the ISPs
conf t
router bgp 200
neighbor 10.0.0.2 remote-as 100
network 12.0.1.0 mask 255.255.255.0
end
!
!Step 6: Configure the Primary and Backup Routes Using Floating Static Routes
conf t
int lo 100
ip add 210.210.210.1 255.255.255.0
no sh
end
Step 7: Configure Primary and Backup Routes Using Static Routes
conf t
router bgp 200
network 210.210.210.0
end
clear ip bgp 10.0.0.2
ISP2
!
!Step 0: Basic Setting
conf t
hostname ISP2
no ip domain-lookup
end
!
!Step 1: Assign IP Addresses
conf t
int s 0/1
ip add 172.16.0.1 255.255.255.252
no sh
int lo0
ip add 172.16.1.1 255.255.255.0
no sh
end
!
!Step 2: Configure the ISPs
conf t
router bgp 300
neighbor 172.16.0.2 remote-as 100
network 172.16.1.0 mask 255.255.255.0
end
show指令
show ip int brief
show ip route
show ip route bgp
show ip bgp
clear指令
clear ip bgp *
clear ip bgp 10.0.0.1 soft out
clear ip bgp 172.16.0.1 soft out
參考文件
Sample Configuration for BGP with Two Different Service Providers (Multihoming)
BGP Soft Reset Enhancement
沒有留言:
張貼留言