配置VS示例
组网需求
如图2-10所示,SwitchA作为网络核心层交换机,同时运行多种二层、三层业务。
网络中,所有业务均需通过物理设备的主控板进行处理。这种情况下,当物理设备上某一业务出现故障而引起整机故障时,其它业务也将无法正常运行。用户希望能在一台物理设备上部署二、三层业务,同时实现二、三层业务之间的相互隔离,在快速区分不同业务的同时,提升网络安全性。
配置思路
创建vs1和vs2,并为vs1和vs2分配物理端口资源和逻辑资源。
为了使后续VS管理员更加方便的管理VS,为VS配置管理IP地址和管理用户。
配置vs1和vs2之间相连的接口,实现VS之间互通。
操作步骤
- 创建VS并为VS分配资源。
# 创建Group模式的vs1和vs2。为vs1分配物理端口40GE1/0/0~40GE1/0/11,为vs2分配物理端口40GE1/0/12~40GE1/0/23。
为Group模式的VS分配端口时,将任意一个端口分配给VS后,该端口所属端口组上的其他端口将自动被分配至VS。例如40GE1/0/0~40GE1/0/11在同一端口组上,将40GE1/0/0分配至vs1后,40GE1/0/0~40GE1/0/11都会被分配至vs1。
当用户为Group模式的VS分配物理端口时,可以先参照VS配置注意事项来查看单板上端口分组情况,以便了解哪些端口会被分配至VS。
<HUAWEI> system-view [~HUAWEI] sysname SwitchA [*HUAWEI] commit [~SwitchA] admin [~SwitchA-admin] virtual-system vs1 [*SwitchA-admin-vs:vs1] port-mode group [*SwitchA-admin-vs:vs1] assign interface 40ge 1/0/0 Warning: All configurations of the interfaces will be deleted. Interfaces 40GE1/0/0-11 of the same group will be assigned. Continue? [Y/N]: y [*SwitchA-admin-vs:vs1] quit [*SwitchA-admin] commit [~SwitchA-admin] virtual-system vs2 [*SwitchA-admin-vs:vs2] port-mode group [*SwitchA-admin-vs:vs2] assign interface 40ge 1/0/12 Warning: All configurations of the interfaces will be deleted. Interfaces 40GE1/0/12-23 of the same group will be assigned. Continue? [Y/N]: y [*SwitchA-admin-vs:vs2] quit [*SwitchA-admin] commit
# 创建逻辑资源模板temp1和temp2,分别加载至vs1和vs2,用来调整vs1和vs2的逻辑资源规格。
VS被创建后会被分配缺省的逻辑资源规格,用户可以通过逻辑资源模板或直接在VS管理视图下执行命令resource调整逻辑资源的规格。使用命令display virtual-system[ name vs-name ] verbose可查看当前VS的逻辑资源规格。
[~SwitchA-admin] resource-template temp1 [*SwitchA-admin-template:temp1] resource vlan upper-limit 2000 [*SwitchA-admin-template:temp1] quit [*SwitchA-admin] resource-template temp2 [*SwitchA-admin-template:temp2] resource vpn-instance upper-limit 1000 [*SwitchA-admin-template:temp2] quit [*SwitchA-admin] commit [~SwitchA-admin] virtual-system vs1 [~SwitchA-admin-vs:vs1] assign resource-template temp1 [*SwitchA-admin-vs:vs1] quit [*SwitchA-admin] virtual-system vs2 [*SwitchA-admin-vs:vs2] assign resource-template temp2 [*SwitchA-admin-vs:vs2] quit [*SwitchA-admin] commit
# 查看VS的状态及分配的资源信息。以查看vs1为例。
[~SwitchA-admin] display virtual-system name vs1 verbose Name : vs1 Status : running Description : Create time : 2018-08-03 03:41:51 Port mode : group System MAC : 0019-7459-3320 Assigned slot(s) pvmb : 5 pvmb : 6 CPU(s) slot 5 : 0% Memory(s) slot 5 : 2%, 112228/3884220 (Used Kbytes/Max Kbytes) Disk(s) 5#flash:/VS_vs1: 0%, 1336/3480880 (Used Kbytes/Max Kbytes) Assigned interface(s) 40GE1/0/0, slot 1 40GE1/0/1, slot 1 40GE1/0/2, slot 1 40GE1/0/3, slot 1 40GE1/0/4, slot 1 40GE1/0/5, slot 1 40GE1/0/6, slot 1 40GE1/0/7, slot 1 40GE1/0/8, slot 1 40GE1/0/9, slot 1 40GE1/0/10, slot 1 40GE1/0/11, slot 1 Assigned resource(s) u4route : 60000(Max) m4route : 1000(Max) u6route : 16000(Max) m6route : 100(Max) vlan : 2000(Max) vpn-instance : 16384(Max) cpu : 5(weight) memory : 100(ratio-threshold) disk : 100(ratio-threshold) mpls : disable trill : disable mcast : enable
- 为VS配置管理IP地址和管理用户。
# 切换进入vs1,配置vs1的管理IP地址及管理用户。vs2的配置过程与vs1类似,过程略。关于管理用户的详细配置请参考《CloudEngine 16800系列交换机配置指南-基础配置》中“配置用户登录”部分。
[~SwitchA-admin] return <SwitchA> switch virtual-system vs1 <SwitchA-vs1> system-view [~SwitchA-vs1] interface MEth 0/0/0 [~SwitchA-vs1-MEth0/0/0] ip address 10.1.1.10 24 [*SwitchA-vs1-MEth0/0/0] quit [*SwitchA-vs1] user-interface vty 0 4 [*SwitchA-vs1-ui-vty0-4] authentication-mode aaa [*SwitchA-vs1-ui-vty0-4] user privilege level 3 [*SwitchA-vs1-ui-vty0-4] quit [*SwitchA-vs1] aaa [*SwitchA-vs1-aaa] local-user vs1_user password cipher VS1_password [*SwitchA-vs1-aaa] local-user vs1_user service-type telnet [*SwitchA-vs1-aaa] local-user vs1_user level 3 [*SwitchA-vs1-aaa] quit [*SwitchA-vs1] undo telnet server disable [*SwitchA-vs1] commit [~SwitchA-vs1] quit <SwitchA-vs1> quit
# 使用配置的IP地址、用户名及密码,验证是否可以通过远程客户端登录VS。以从PC客户端登录vs1为例。
请确保客户端与VS之间路由可达。
C:\Documents and Settings\Administrator> telnet 10.1.1.10 Username:vs1_user Password: Warning: Please change the original password. The password needs to be changed. Change now? [Y/N]: n Info: The max number of VTY users is 5, the number of current VTY users online is 1, and total number of terminal users online is 1. The current login time is 2013-03-22 19:06:41. First login successfully. <vs1>
- 配置vs1和vs2之间互通。
# 配置vs1和vs2互连接口的IP地址,实现vs1和vs2之间互通。VS作为独立的逻辑系统,彼此之间的互通类似于不同物理设备之间的互通,需要通过VS之间的物理接口相连。
<SwitchA> switch virtual-system vs1 <SwitchA-vs1> system-view [~SwitchA-vs1] interface 40ge 1/0/1 [~SwitchA-vs1-40GE1/0/1] undo portswitch [*SwitchA-vs1-40GE1/0/1] ip address 10.10.10.1 24 [*SwitchA-vs1-40GE1/0/1] commit [~SwitchA-vs1-40GE1/0/1] return <SwitchA-vs1> quit <SwitchA> switch virtual-system vs2 <SwitchA-vs2> system-view [~SwitchA-vs2] interface 40ge 1/0/13 [~SwitchA-vs2-40GE1/0/13] undo portswitch [*SwitchA-vs2-40GE1/0/13] ip address 10.10.10.2 24 [*SwitchA-vs2-40GE1/0/13] commit [~SwitchA-vs2-40GE1/0/13] return <SwitchA-vs2> quit
# VS之间互ping,检查VS之间能否互通。以vs1 ping vs2为例。
<SwitchA> switch virtual-system vs1 <SwitchA-vs1> ping 10.10.10.2 PING 10.10.10.2: 56 data bytes, press CTRL_C to break Reply from 10.10.10.2: bytes=56 Sequence=1 ttl=254 time=4 ms Reply from 10.10.10.2: bytes=56 Sequence=2 ttl=254 time=10 ms Reply from 10.10.10.2: bytes=56 Sequence=3 ttl=254 time=8 ms Reply from 10.10.10.2: bytes=56 Sequence=4 ttl=254 time=4 ms Reply from 10.10.10.2: bytes=56 Sequence=5 ttl=254 time=4 ms --- 10.10.10.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 4/6/10 ms
配置文件
SwitchA的配置文件
# sysname SwitchA # admin resource-template temp1 resource vlan upper-limit 2000 resource-template temp2 resource vpn-instance upper-limit 1000 virtual-system vs1 port-mode group resource u4route upper-limit 60000 resource m4route upper-limit 1000 resource u6route upper-limit 16000 resource vlan upper-limit 2000 resource mcast enable resource vpn-instance upper-limit 16384 resource cpu weight 5 resource memory ratio-threshold 100 resource disk ratio-threshold 100 assign interface 40GE1/0/0 assign interface 40GE1/0/1 assign interface 40GE1/0/2 assign interface 40GE1/0/3 assign interface 40GE1/0/4 assign interface 40GE1/0/5 assign interface 40GE1/0/6 assign interface 40GE1/0/7 assign interface 40GE1/0/8 assign interface 40GE1/0/9 assign interface 40GE1/0/10 assign interface 40GE1/0/11 virtual-system vs2 port-mode group resource u4route upper-limit 60000 resource m4route upper-limit 1000 resource u6route upper-limit 16000 resource vlan upper-limit 4094 resource mcast enable resource vpn-instance upper-limit 1000 resource cpu weight 5 resource memory ratio-threshold 100 resource disk ratio-threshold 100 assign interface 40GE1/0/12 assign interface 40GE1/0/13 assign interface 40GE1/0/14 assign interface 40GE1/0/15 assign interface 40GE1/0/16 assign interface 40GE1/0/17 assign interface 40GE1/0/18 assign interface 40GE1/0/19 assign interface 40GE1/0/20 assign interface 40GE1/0/21 assign interface 40GE1/0/22 assign interface 40GE1/0/23 # return
vs1的配置文件
# sysname vs1 # aaa local-user vs1_user password cipher %^%#TT4N+w]%[C+rM>)S8Ti!'p1iV@RZh(3MO7QGd96Z%^%# local-user vs1_user service-type telnet local-user vs1_user level 3 # interface MEth0/0/0 ip address 10.1.1.10 255.255.255.0 # interface 40GE1/0/1 undo portswitch ip address 10.10.10.1 255.255.255.0 # user-interface vty 0 4 authentication-mode aaa user privilege level 3 # return
vs2的配置文件
# sysname vs2 # aaa local-user vs2_user password cipher %^%#%j]%Lv%StAqIveR"YfuS<{^%;~p*$D<&&@X/Xs(/%^%# local-user vs2_user service-type telnet local-user vs2_user level 3 # interface MEth0/0/0 ip address 10.1.1.20 255.255.255.0 # interface 40GE1/0/13 undo portswitch ip address 10.10.10.2 255.255.255.0 # user-interface vty 0 4 authentication-mode aaa user privilege level 3 # return