BGP的几种属性的修改
R0(config)#router bgp 1
R0(config-router)#neighbor 172.16.1.2 remote-as 2
R0(config-router)#neighbor 192.168.1.2 remote-as 2
R0(config-router)#network 1.1.1.1 mask 255.255.255.255
R0(config-router)#exit
|
R1(config)#router bgp 2
R1(config-router)#neighbor 172.16.1.1 remote-as 1
R1(config-router)#neighbor 192.168.1.1 remote-as 1
R1(config-router)#network 2.2.2.2 mask 255.255.255.255
R1(config-router)#exit
|
R0#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
*> 2.2.2.2/32 172.16.1.2 0 0 2 i
* 192.168.1.2 0 0 2 i
|
R0#sh ip route
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
B 2.2.2.2 [20/0] via 172.16.1.2, 00:07:54
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, FastEthernet0/0
C 192.168.1.0/24 is directly connected, Ethernet1/0
|
R0(config)#router bgp 1
R0(config-router)#neighbor 192.168.1.2 weight 100
R0(config-router)#end
|
R0#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
* 2.2.2.2/32 172.16.1.2 0 0 2 i
*> 192.168.1.2 0 100 2 i
|
R0#sh ip rout
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
B 2.2.2.2 [20/0] via 192.168.1.2, 00:03:10
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, FastEthernet0/0
C 192.168.1.0/24 is directly connected, Ethernet1/0
|
R1(config)#router bgp 2
R1(config-router)#bgp default local-preference 200
R1(config-router)#end
R1#clear ip bgp * s
|
R1(config)#route-map xx permit 10
R1(config-route-map)#set local-preference 200
R1(config-route-map)#exit
R1(config)#router bgp 2
R1(config-router)#neighbor 192.168.1.1 route-map xx out
R1(config-router)#end
|
R1(config)#route-map x permit 10
R1(config-route-map)#set as-path prepend 3 3 3 3 3
R1(config-route-map)#exit
R1(config)#router bgp 2
R1(config-router)#neighbor 172.16.1.1 route-map x out
R1(config-router)#end
R1#clear ip bgp * s
|
R0#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
* 2.2.2.2/32 172.16.1.2 0 0 2 3 3 3 3 3 i
*> 192.168.1.2 0 0 2 i
|
R1(config)#route-map x permit 10
R1(config-route-map)#set origin incomplete
R1(config-route-map)#exit
R1(config)#router bgp 2
R1(config-router)#neighbor 172.16.1.1 route-map x out
R1(config-router)#end
R1#clear ip bgp * s
|
R0#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
* 2.2.2.2/32 172.16.1.2 0 0 2 ?
*> 192.168.1.2 0 0 2 i
|
R1(config)#route-map x permit 10
R1(config-route-map)#set metric 10
R1(config-route-map)#exit
R1(config)#router bgp 2
R1(config-router)#neighbor 172.16.1.1 route-map x out
R1(config-router)#end
R1#clear ip bgp * s
|
R0#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
* 2.2.2.2/32 172.16.1.2 10 0 2 i
*> 192.168.1.2 0 0 2 i
|