-
配置各接口所属的VLAN
[LSW1]vlan batch 10
[LSW1-GigabitEthernet0/0/2]port link-type trunk
[LSW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10
[LSW2]vlan batch 10 20
[LSW2-GigabitEthernet0/0/1]port link-type trunk
[LSW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[LSW2-GigabitEthernet0/0/3]port link-type trunk
[LSW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 20
[LSW3]vlan batch 20 30 40 50
[LSW3-GigabitEthernet0/0/2]port link-type trunk
[LSW3-GigabitEthernet0/0/2]port trunk allow-pass vlan 20
[LSW3-GigabitEthernet0/0/3]port link-type trunk
[LSW3-GigabitEthernet0/0/3]port trunk allow-pass vlan 30
[LSW3-GigabitEthernet0/0/4]port link-type trunk
[LSW3-GigabitEthernet0/0/4]port trunk allow-pass vlan 40
[LSW3-GigabitEthernet0/0/5]port link-type trunk
[LSW3-GigabitEthernet0/0/5]port trunk allow-pass vlan 50 -
配置各VLANIF接口的IP地址
[LSW1-Vlanif10]ip add 10.1.1.1 24
[LSW2-Vlanif10]ip add 10.1.1.2 24
[LSW2-Vlanif20]ip add 10.1.2.2 24
[LSW3-Vlanif20]ip add 10.1.2.3 24
[LSW3-Vlanif30]ip add 172.17.1.1 24
[LSW3-Vlanif40]ip add 172.17.2.1 24
[LSW3-Vlanif50]ip add 172.17.3.1 24 -
配置IS-IS路由协议
[LSW3]isis
[LSW3-isis-1]is-level level-2
[LSW3-isis-1]network-entity 10.0000.0000.0001.00
[LSW3-Vlanif20]isis enable
[LSW3-Vlanif30]isis enable
[LSW3-Vlanif40]isis enable
[LSW3-Vlanif50]isis enable
[LSW2]isis
[LSW2-isis-1]is-level level-2
[LSW2-isis-1]network-entity 10.0000.0000.0002.00
[LSW2-Vlanif20]isis enable -
配置OSPF路由协议及路由引入
[LSW1]ospf
[LSW1-ospf-1]area 0
[LSW1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[LSW2]ospf
[LSW2-ospf-1]area 0
[LSW2-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[LSW2-ospf-1]import-route isis 1
-
配置过滤列表
[LSW2]acl 2001
[LSW2-acl-basic-2001]rule permit source 172.17.2.0 0.0.0.255 //编号为2001的ACL,允许172.17.2.0/24通过
[LSW2]ip ip-prefix a1 index 10 permit 172.17.1.0 24 //配置名为a1的地址前缀列表,允许172.17.1.0/24通过 -
配置Route-Policy
[LSW2]route-policy isis2ospf permit node 10
[LSW2-route-policy]if-match ip-prefix a1
[LSW2-route-policy]apply cost 100 //将172.17.1.0/24的路由的开销设置为100
[LSW2]route-policy isis2ospf permit node 20
[LSW2-route-policy]if-match acl 2001
[LSW2-route-policy]apply tag 20 //将172.17.2.0/24的路由的Tag属性设置为20
[LSW2]route-policy isis2ospf permit node 30 -
在路由引入时应用Route-Policy
[LSW2]ospf
[LSW2-ospf-1]import-route isis 1 route-policy isis2ospf
华为设备在路由引入时应用路由策略
最新推荐文章于 2024-09-13 17:34:32 发布