标签:拓扑 ctr ble 回顾 from status prot client ctrl
第一步 配置OSPF保证路由器直接网络连通性
R1配置如下:
[R1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R1]interface g0/0/2
[R1-GigabitEthernet0/0/2]ip address 192.168.1.254 24
[R1-GigabitEthernet0/0/2]dhcp select interface
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.12.1 24
[R1-GigabitEthernet0/0/0]q
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 10.10.1.1 24
[R1-LoopBack0]q
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 192.168.12.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 10.10.1.1 255.255.255.255
R2配置如下:
[R2]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R2]interface g0/0/2
[R2-GigabitEthernet0/0/2]ip address 192.168.2.254 24
[R2-GigabitEthernet0/0/2]dhcp select interface
[R2]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.12.2 24.
[R2-GigabitEthernet0/0/1]q
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.23.2 24.
[R2-GigabitEthernet0/0/0]q
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 10.10.2.2 24
[R2-LoopBack0]q
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 192.168.12.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 192.168.23.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 10.10.2.2 255.255.255.255
R3配置如下:
[R2]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R3]interface g0/0/2
[R3-GigabitEthernet0/0/2]ip address 192.168.3.254 24
[R3-GigabitEthernet0/0/2]dhcp select interface
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.23.3 24
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 10.10.3.3 24
[R3-LoopBack0]q
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 192.168.23.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 10.10.3.3 255.255.255.255
测试路由器直接连通性:
在R1上ping路由器R3,网络互通
[R1]ping 10.10.3.3
PING 10.10.3.3: 56 data bytes, press CTRL_C to break
Reply from 10.10.3.3: bytes=56 Sequence=1 ttl=254 time=40 ms
Reply from 10.10.3.3: bytes=56 Sequence=2 ttl=254 time=20 ms
Reply from 10.10.3.3: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 10.10.3.3: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 10.10.3.3: bytes=56 Sequence=5 ttl=254 time=50 ms
--- 10.10.3.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/34/50 ms
此时查看R1bgp路由表和R3的路由表如下;
bgp路由表
[R1]display bgp routing-table
BGP Local router ID is 1.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 12
Network NextHop MED LocPrf PrefVal Path/Ogn
> 10.10.1.0/24 0.0.0.0 0 0 ?
> 10.10.1.1/32 0.0.0.0 0 0 ?
>i 10.10.2.0/24 10.10.2.2 0 100 0 ?
> 127.0.0.0 0.0.0.0 0 0 ?
> 127.0.0.1/32 0.0.0.0 0 0 ?
> 192.168.1.0 0.0.0.0 0 0 ?
> 192.168.1.254/32 0.0.0.0 0 0 ?
>i 192.168.2.0 10.10.2.2 0 100 0 ?
*> 192.168.12.0 0.0.0.0 0 0 ?
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.10.1.1/32 OSPF 10 2 D 192.168.23.2 GigabitEthernet
0/0/1
10.10.2.0/24 IBGP 255 0 RD 10.10.2.2 GigabitEthernet
0/0/1
10.10.2.2/32 OSPF 10 1 D 192.168.23.2 GigabitEthernet
0/0/1
10.10.3.0/24 Direct 0 0 D 10.10.3.3 LoopBack0
10.10.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.10.3.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.2.0/24 IBGP 255 0 RD 10.10.2.2 GigabitEthernet
0/0/1
192.168.3.0/24 Direct 0 0 D 192.168.3.254 GigabitEthernet
0/0/2
192.168.3.254/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.3.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.12.0/24 OSPF 10 2 D 192.168.23.2 GigabitEthernet
0/0/1
192.168.23.0/24 Direct 0 0 D 192.168.23.3 GigabitEthernet
0/0/1
192.168.23.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.23.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
R1的路由表和bgp路由表如下:
[R1]display bgp routing-table
BGP Local router ID is 1.1.1.1
Status codes: * - valid, > - best, d - damped,
h - history, i - internal, s - suppressed, S - Stale
Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 14
Network NextHop MED LocPrf PrefVal Path/Ogn
> 10.10.1.0/24 0.0.0.0 0 0 ?
> 10.10.1.1/32 0.0.0.0 0 0 ?
>i 10.10.2.0/24 10.10.2.2 0 100 0 ?
>i 10.10.3.0/24 10.10.3.3 0 100 0 ?
> 127.0.0.0 0.0.0.0 0 0 ?
> 127.0.0.1/32 0.0.0.0 0 0 ?
> 192.168.1.0 0.0.0.0 0 0 ?
> 192.168.1.254/32 0.0.0.0 0 0 ?
>i 192.168.2.0 10.10.2.2 0 100 0 ?
>i 192.168.3.0 10.10.3.3 0 100 0 ?
*> 192.168.12.0 0.0.0.0 0 0 ?
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.10.1.0/24 Direct 0 0 D 10.10.1.1 LoopBack0
10.10.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.10.1.255/32 Direct 0 0 D 127.0.0.1 LoopBack0
10.10.2.0/24 IBGP 255 0 RD 10.10.2.2 GigabitEthernet
0/0/0
10.10.2.2/32 OSPF 10 1 D 192.168.12.2 GigabitEthernet
0/0/0
10.10.3.0/24 IBGP 255 0 RD 10.10.3.3 GigabitEthernet
0/0/0
10.10.3.3/32 OSPF 10 2 D 192.168.12.2 GigabitEthernet
0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 Direct 0 0 D 192.168.1.254 GigabitEthernet
0/0/2
192.168.1.254/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.2.0/24 IBGP 255 0 RD 10.10.2.2 GigabitEthernet
0/0/0
192.168.3.0/24 IBGP 255 0 RD 10.10.3.3 GigabitEthernet
0/0/0
192.168.12.0/24 Direct 0 0 D 192.168.12.1 GigabitEthernet
0/0/0
192.168.12.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.23.0/24 OSPF 10 2 D 192.168.12.2 GigabitEthernet
0/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
Ping 192.168.3.253: 32 data bytes, Press Ctrl_C to break
From 192.168.3.253: bytes=32 seq=1 ttl=125 time=31 ms
From 192.168.3.253: bytes=32 seq=2 ttl=125 time=32 ms
From 192.168.3.253: bytes=32 seq=3 ttl=125 time=31 ms
From 192.168.3.253: bytes=32 seq=4 ttl=125 time=15 ms
From 192.168.3.253: bytes=32 seq=5 ttl=125 time=32 ms
标签:拓扑 ctr ble 回顾 from status prot client ctrl
原文地址:http://blog.51cto.com/11806823/2299712