赞
踩
配置各接口所属的VLAN
[LSW1]vlan batch 10 50
[LSW1-GigabitEthernet0/0/2]port link-type trunk
[LSW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10
[LSW1-GigabitEthernet0/0/5]port link-type trunk
[LSW1-GigabitEthernet0/0/5]port trunk allow-pass vlan 50
[LSW2]vlan batch 10 20 40
[LSW2-GigabitEthernet0/0/3]port link-type trunk
[LSW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 20
[LSW2-GigabitEthernet0/0/4]port link-type trunk
[LSW2-GigabitEthernet0/0/4]port trunk allow-pass vlan 40
[LSW2-GigabitEthernet0/0/1]port link-type trunk
[LSW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[LSW3]vlan batch 20 30
[LSW3-GigabitEthernet0/0/2]port link-type trunk
[LSW3-GigabitEthernet0/0/2]port trunk allow-pass vlan 20
[LSW3-GigabitEthernet0/0/4]port link-type trunk
[LSW3-GigabitEthernet0/0/4]port trunk allow-pass vlan 30
[LSW4]vlan batch 30 40
[LSW4-GigabitEthernet0/0/3]port link-type trunk
[LSW4-GigabitEthernet0/0/3]port trunk allow-pass vlan 30
[LSW4-GigabitEthernet0/0/2]port link-type trunk
[LSW4-GigabitEthernet0/0/2]port trunk allow-pass vlan 40
配置各VLANIF接口的IP地址
[LSW1-Vlanif10]ip add 10.1.1.1 24
[LSW1-Vlanif50]ip add 10.1.5.1 24
[LSW2-Vlanif10]ip add 10.1.1.2 24
[LSW2-Vlanif20]ip add 10.1.2.2 24
[LSW2-Vlanif40]ip add 10.1.4.2 24
[LSW3-Vlanif20]ip add 10.1.2.3 24
[LSW3-Vlanif30]ip add 10.1.3.3 24
[LSW4-Vlanif30]ip add 10.1.3.4 24
[LSW4-Vlanif40]ip add 10.1.4.4 24
[LSW1]stp disable
[LSW2]stp disable
[LSW3]stp disable
[LSW4]stp disable
配置IBGP连接
[LSW2]bgp 65002
[LSW2-bgp]router-id 2.2.2.2
[LSW2-bgp]peer 10.1.2.3 as-number 65002
[LSW2-bgp]peer 10.1.4.4 as-number 65002
[LSW3]bgp 65002
[LSW3-bgp]router-id 3.3.3.3
[LSW3-bgp]peer 10.1.2.2 as-number 65002
[LSW3-bgp]peer 10.1.3.4 as-number 65002
[LSW4]bgp 65002
[LSW4-bgp]router-id 4.4.4.4
[LSW4-bgp]peer 10.1.3.3 as-number 65002
[LSW4-bgp]peer 10.1.4.2 as-number 65002
配置EBGP
[LSW1]bgp 65001
[LSW1-bgp]router-id 1.1.1.1
[LSW1-bgp]peer 10.1.1.2 as-number 65002
[LSW2]bgp 65002
[LSW2-bgp]peer 10.1.1.1 as-number 65001
配置LSW1发布路由
[LSW1]bgp 65001
[LSW1-bgp]ipv4-family unicast
[LSW1-bgp-af-ipv4]network 10.1.5.0 255.255.255.0
从路由表可以看出,LSW3和LSW4学到了AS65001中的10.1.5.0的路由,但因为下一跳10.1.1.1不可达,所以也不是有效路由
6. 配置BGP引入直连路由
[LSW2]bgp 65002
[LSW2-bgp]ipv4-family unicast
[LSW2-bgp-af-ipv4]import-route direct
可以看出10.1.5.0的路由变为有效路由
7.验证配置
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。