VPC添加专线
2017-12-01 15:53:08    381    0    0
7wlnk13

 

1、在ECSAG上,查看通道信息

[root@ecsag ~]# echo 'select vcon_id,sw_con_id,vlan_id,status from virtual_connection where vlan_id="1001";' | (go2vpcregiondbrnd) 
vcon_id                 sw_con_id                vlan_id         status
VCON-bby4iuy36        SCON-bby4iuy36            1001              free​

 

2、在ECSAG上,查看 region_id

[root@ecsag ~]# go2info | head -2 | tail -1 | awk -F ":" '{print $3}'
cn-gx-gxgd-d01​

 

3、在ECSAG上,将通道设置为使assigned

[root@ecsag ~]# go2hyapi modify_sw_connection region_id=cn-gx-gxgd-d01 con_id=SCON-bby4iuy36 status=assigned​

 

4、在ECSAG上,将VPC与通道绑定

[root@ecsag ~]# go2hyapi assign_virtual_connection region_id=cn-gx-gxgd-d01 vcon_id=VCON-bby4iuy36 vpc_id=vpc-88bs870zv ​

如果提示'user_vlan_gateway_ip' is required when calling assign_virtual_connection (<user_vlan_gateway_ip>).错误。

# 解决:
[root@ecsag ~]# vim /etc/houyi_pet/tools/houyi_manage/toolkit/houyi_api.sh
#将下行
function assign_virtual_connection() # <region_id> <vcon_id> <vpc_id> <user_vlan_gateway_ip> <hc_ip>
#修改成
function assign_virtual_connection() # <region_id> <vcon_id> <vpc_id> [user_vlan_gateway_ip] [hc_ip]​

 

5、在ECSAG上,添加VPC到MGW的路由

[root@ecsag ~]# go2hyapi add_vpc_route_entry region_id=cn-gx-gxgd-d01 vpc_id=vpc-88bs870zv dst_cidr_block=10.6.6.6/32 scope=vconnection nexthop=VCON-bby4iuy36​

 

 

6、在CSW上,配置vpn-instance。

[*CSW] vlan 1001
[*CSW-Vlan1001] interface vlanif 1001
[*CSW-Vlanif1001] description test_vpc
[*CSW-Vlanif1001] ip binding vpn-instance L_vpc_1
[*CSW-Vlanif1001] ip address 10.0.16.14 255.255.255.240
[*CSW] commit​

 

7、在CSW上添加到对应VPC网络的路由

[*CSW] ip route-static vpn-instance L_vpc_1 172.16.0.0 24 10.2.16.1 description test-vpc
[*CSW] ip route-static vpn-instance L_vpc_1 172.16.0.0 24 10.2.16.2 description test-vpc
[*CSW] ip route-static vpn-instance L_vpc_1 172.16.0.0 24 10.2.16.3 description test-vpc   
[*CSW] ip route-static vpn-instance L_vpc_1 172.16.0.0 24 10.2.16.4 description test-vpc
[*CSW] commit​

 

 

-------------------------------------------------------------------------------------------------------------------------------------------------------

查看VPC专线状态 

 

1、查看vpc对应的通道

[root@ecsag ~]# echo 'select * from virtual_connection_ext4vpc where vpc_id="vpc-88bs870zv";' | (go2vpcregiondbrnd)
id gmt_create gmt_modify vcon_id vpc_id
1 2017-11-28 16:58:47 2017-11-28 16:58:47 VCON-bby4iuy36 vpc-88bs870zv
 
2、在查询vcon_id对应的vlan_id
[root@ecsag ~]# echo 'select vcon_id,sw_con_id,vlan_id,status from virtual_connection where vcon_id="VCON-bby4iuy36";' | (go2vpcregiondbrnd)
vcon_id sw_con_id vlan_id status
VCON-bby4iuy36 SCON-bby4iuy36 1001 assigned
 
3、在XGW上,查看vpc路由表的情况
[root@xgw1 ~]# vgw_admin --table vpc-rt --list --vpc-id 3537102 
VPC-ID Destination Mask Scope Next Hop weight status
______ _______________ _______________ _______________ _______________ ______ ______
3537102 100.64.0.0 10 natgw 0.0.0.0 100 enable
3537102 10.2.2.0 23 natgw 0.0.0.0 100 enable
3537102 172.16.1.0 24 local 0.0.0.0 100 enable
3537102 10.2.5.162 32 natgw 0.0.0.0 100 enable
3537102 10.2.5.176 32 natgw 0.0.0.0 100 enable
NATGW IP can't be 0.0.0.0, please configure NATGW IP first!
 
4、在MGW上,查看MGW隧道信息
[root@mgw1 ~]# mgw_admin --list
VLAN_ID TUNNEL_ID VGW_IP GATEWAY 
1001 3537102 10.2.19.61 10.2.16.14
 
5、在CSW上,查看L_vpc_1的路由信息
[*CSW] display ip routing-table vpn-instance L_vpc_1
 
 
 
 
 
 

上一篇: qemu-system-x86_64命令总结

下一篇: iptables做双向NAT

381 人读过
立即登录, 发表评论.
没有帐号? 立即注册
0 条评论
文档导航