API Guide

SW 2
VLAN 配置
创建 VLAN 并为其分配充当 VM 中主机的网关的 IP 地址。
OS10# configure terminal
OS10(config)# interface vlan 100
OS10(conf-if-vl-100)# no shutdown
OS10(conf-if-vl-100)# ip address
OS10(conf-if-vl-100)# ip address 10.1.1.2/24
OS10(conf-if-vl-100)# exit
创建另一个 VLAN 并为其分配 IP 地址。
OS10# configure terminal
OS10(config)# interface vlan 200
OS10(conf-if-vl-200)# no shutdown
OS10(conf-if-vl-200)# ip address
OS10(conf-if-vl-200)# ip address 10.2.1.3/24
OS10(conf-if-vl-200)# exit
VLT 配置
1. 创建 VLT 域并配置 VLTi
OS10(config)# interface range ethernet 1/1/4-1/1/5
OS10(conf-range-eth1/1/4-1/1/5)# no switchport
OS10(conf-range-eth1/1/4-1/1/5)# exit
OS10(config)# vlt-domain 1
OS10(conf-vlt-1)# discovery-interface ethernet 1/1/4-1/1/5
2. 配置 VLT MAC 地址。
OS10(conf-vlt-1)# vlt-mac 12:5e:23:f4:23:54
3. 指定 VLT 对等节点的管理 IP 地址作为备份链路。
OS10(conf-vlt-1)# backup destination 10.10.10.1
4. 配置 VLT 端口通道。
SW2 VM VLT 端口通道配置
OS10(config)# interface port-channel 10
OS10(conf-if-po-10)# description SW2ToVM
OS10(conf-if-po-10)# vlt-port-channel 10
OS10(conf-if-po-10)# switchport mode trunk
OS10(conf-if-po-10)# switchport trunk allowed vlan 100,200
OS10(conf-if-po-10)# exit
OS10(config)# interface ethernet 1/1/2-1/1/3
OS10(conf-if-eth1/1/2-1/1/3)# no shutdown
OS10(conf-if-eth1/1/2-1/1/3)# channel-group 10
可选对等节点路由配置
配置对等节点路由。
OS10(config)# vlt-domain 1
OS10(conf-vlt-1)# peer-routing
PBR 配置
在两个 VLT 对等节点的 VLTi 接口上应用策略。
OS10(config)# ip access-list PBR-A2C
OS10(conf-ipv4-acl)# permit ip 10.10.10.0/24 any
OS10(conf-route-map)# route-map Map1
OS10(conf-route-map)# match ip address PBR-A2C
OS10(conf-route-map)# set ip next-hop 10.10.20.10
OS10(conf-route-map)# exit
3 703