上接vxlan专题—第二章的内容。本章主要讲不通租户之间的隔离及业务互访,租户之间的隔离一般采用防火墙虚拟系统实行。
1、拓扑图
2、配置
配置vrf及三次vni
ip vpn-instance A
ipv4-family
route-distinguisher 1:1
vpn-target 10:10 export-extcommunity evpn
vpn-target 10:10 import-extcommunity evpn
vxlan vni 99
vpn-target必须是evpn,并且启用三层vni用于传递tpye 3路由。
整体配置
sysname CE01
#
device board 17 board-type CE-MPUB
device board 1 board-type CE-LPUE
#
evpn-overlay enable
#
ip vpn-instance A
ipv4-family
route-distinguisher 1:1
vpn-target 10:10 export-extcommunity
vpn-target 10:10 export-extcommunity evpn
vpn-target 10:10 import-extcommunity
vpn-target 10:10 import-extcommunity evpn
vxlan vni 99
#
bridge-domain 10
vxlan vni 10
evpn
route-distinguisher 1:10
vpn-target 10:10 export-extcommunity
vpn-target 10:10 import-extcommunity
#
bridge-domain 20
vxlan vni 20
evpn
route-distinguisher 1:20
vpn-target 20:20 export-extcommunity
vpn-target 20:20 import-extcommunity
#
aaa
#
authentication-scheme default
#
authorization-scheme default
#
accounting-scheme default
#
domain default
#
domain default_admin
#
interface Vbdif10
ip binding vpn-instance A
ip address 192.168.1.254 255.255.255.0
mac-address 0000-5e00-0001
vxlan anycast-gateway enable
arp collect host enable
#
interface Vbdif20
ip binding vpn-instance A
ip address 172.16.1.254 255.255.255.0
mac-address 0000-5e00-0002
vxlan anycast-gateway enable
arp collect host enable
#
interface MEth0/0/0
undo shutdown
#
interface GE1/0/0
undo portswitch
undo shutdown
#
interface GE1/0/0.10 mode l2
encapsulation dot1q vid 10
bridge-domain 10
#
interface GE1/0/0.20 mode l2
encapsulation dot1q vid 20
bridge-domain 20
#
interface GE1/0/1
undo portswitch
undo shutdown
ip address 13.1.1.1 255.255.255.0
#
interface GE1/0/2
undo shutdown
#
interface GE1/0/3
undo shutdown
#
interface GE1/0/4
undo shutdown
#
interface GE1/0/5
undo shutdown
#
interface GE1/0/6
undo shutdown
#
interface GE1/0/7
undo shutdown
#
interface GE1/0/8
undo shutdown
#
interface GE1/0/9
undo shutdown
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface Nve1
source 1.1.1.1
vni 10 head-end peer-list protocol bgp
vni 20 head-end peer-list protocol bgp
#
interface NULL0
#
bgp 100 instance evpn1
router-id 1.1.1.1
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
#
l2vpn-family evpn
policy vpn-target
peer 3.3.3.3 enable
peer 3.3.3.3 advertise irb
#
ospf 10 router-id 1.1.1.1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 13.1.1.1 0.0.0.0
2、业务隔离
2、虚拟防火墙配置:
配置思路
采用如下思路配置两个虚拟系统直接互访:1.开启虚拟系统功能,分别创建虚拟系统vsysa和vsysb并为其分配资源。
2.在根系统、虚拟系统vsysa和vsysb下分别配置接口,并将接口加人安全区域。
3.在根系统下配置路由,对网络A和网络B之间互访的流量进行引流。
4.在虚拟系统vsysa和vsysb下分别配置路由,对设备发往网络A和网络B的流量进行引流。
5.在虚拟系统vsysa和vsysb下分别配置安全策略,放行网络A和网络B之间互访的流量。
操作步骤
1.开启虚拟系统功能。
<HUAWEI> system-view
[HUAWEI] sysname Device
[Device] vsys enable
2.创建虚拟系统并为其分配资源。
创建虚拟系统vsysa并为其分配资源。
[Device] vsys name vsysa
[Device-vsys-vsysa] assign interface 10ge 0/0/2
[Device-vsys-vsysa] quit
创建虚拟系统vsysb并为其分配资源。
[Device] vsys name vsysb
[Device-vsys-vsysb] assign interface 10ge 0/0/1
[Device-vsys-vsysb] quit
3.配置根系统下的接口Virtual-if0,并将接口加入安全区域。
[Device] interface Virtual-if 0
[Device-Virtual-if0] ip address 172.16.0.1 24
[Device-Virtual-if0] quit
[Device] firewall zone trust
[Device-zone-trust] add interface Virtual-if 0
[Device-zone-trust] quit
4.配置根系统下的路由。
配置虚拟系统vsysa到虚拟系统vsysb的路由,将网络A中的用户主动访问网络B的去程流量引入虚拟系统vsysb。
[Device] ip route-static vpn-instance vsysa 10.3.1.0 255.255.255.0 vpn-instance vsysb
配置虚拟系统vsysb到虚拟系统vsysa的路由,将网络B中的用户主动访问网络A的去程流量引入虚拟系统vsysa。
[Device] ip route-static vpn-instance vsysb 10.3.0.0 255.255.255.0 vpn-instance vsysa
5.切换到虚拟系统vsysa的系统视图。
[Device] switch vsys vsysa
<Device-vsysa> system-view
6.配置虚拟系统vsysa下的接口并将接口加入安全区域。
[Device-vsysa] interface 10ge 0/0/2
[Device-vsysa-10GE0/0/2] ip address 10.3.0.1 24
[Device-vsysa-10GE0/0/2] quit
[Device-vsysa] interface Virtual-if 1
[Device-vsysa-Virtual-if1] ip address 172.16.1.1 24
[Device-vsysa-Virtual-if1] quit
[Device-vsysa] firewall zone trust
[Device-vsysa-zone-trust] add interface 10ge 0/0/2
[Device-vsysa-zone-trust] quit
[Device-vsysa] firewall zone untrust
[Device-vsysa-zone-untrust] add interface Virtual-if 1
[Device-vsysa-zone-untrust] quit
7.配置虚拟系统vsysa下的路由。
配置虚拟系统vsysa到网络A的路由,将网络A中的用户主动访问网络B的回程流量,或网络B中的用户主动访问网络A的去程流量引入网络A。其中,10.3.0.254是虚拟系统vsysa到网络A的下一跳。
[Device-vsysa] ip route-static 10.3.0.0 255.255.255.0 10.3.0.254
8.配置虚拟系统vsysa下的安全策略。
配置trust到untrust的安全策略,放行网络A中的用户主动访问网络B的流量。
[Device-vsysa] security-policy
[Device-vsysa-policy-security] rule name vsysa_trust_to_untrust
[Device-vsysa-policy-security-rule-vsysa_trust_to_untrust] source-zone trust
[Device-vsysa-policy-security-rule-vsysa_trust_to_untrust] destination-zone untrust
[Device-vsysa-policy-security-rule-vsysa_trust_to_untrust] source-address 10.3.0.0 24
[Device-vsysa-policy-security-rule-vsysa_trust_to_untrust] destination-address 10.3.1.0 24
[Device-vsysa-policy-security-rule-vsysa_trust_to_untrust] action permit
[Device-vsysa-policy-security-rule-vsysa_trust_to_untrust] quit
配置untrust到trust的安全策略,放行网络B中的用户主动访问网络A的流量。
[Device-vsysa-policy-security] rule name vsysa_untrust_to_trust
[Device-vsysa-policy-security-rule-vsysa_untrust_to_trust] source-zone untrust
[Device-vsysa-policy-security-rule-vsysa_untrust_to_trust] destination-zone trust
[Device-vsysa-policy-security-rule-vsysa_untrust_to_trust] source-address 10.3.1.0 24
[Device-vsysa-policy-security-rule-vsysa_untrust_to_trust] destination-address 10.3.0.0 24
[Device-vsysa-policy-security-rule-vsysa_untrust_to_trust] action permit
[Device-vsysa-policy-security-rule-vsysa_untrust_to_trust] quit
[Device-vsysa-policy-security] quit
9.切换到虚拟系统vsysb的系统视图。
[Device-vsysa] quit
<Device-vsysa> quit
[Device] switch vsys vsysb
<Device-vsysb> system-view
10.配置虚拟系统vsysb下的接口并将接口加入安全区域。
[Device-vsysb] interface 10ge 0/0/1
[Device-vsysb-10GE0/0/1] ip address 10.3.1.1 24
[Device-vsysb-10GE0/0/1] quit
[Device-vsysb] interface Virtual-if 2
[Device-vsysb-Virtual-if2] ip address 172.16.2.1 24
[Device-vsysb-Virtual-if2] quit
[Device-vsysb] firewall zone trust
[Device-vsysb-zone-trust] add interface 10ge 0/0/1
[Device-vsysb-zone-trust] quit
[Device-vsysb] firewall zone untrust
[Device-vsysb-zone-untrust] add interface Virtual-if 2
[Device-vsysb-zone-untrust] quit
11.配置虚拟系统vsysb下的路由。
配置虚拟系统vsysb到网络B的路由,将网络A中的用户主动访问网络B的去程流量,或网络B中的用户主动访问网络A的回程流量引入网络B。其中,10.3.1.254是虚拟系统vsysb到网络B的下一跳。
[Device-vsysb] ip route-static 10.3.1.0 255.255.255.0 10.3.1.254
12.配置虚拟系统vsysb下的安全策略。
配置trust到untrust的安全策略,放行网络B中的用户主动访问网络A的流量。
[Device-vsysb] security-policy
[Device-vsysb-policy-security] rule name vsysb_trust_to_untrust
[Device-vsysb-policy-security-rule-vsysb_trust_to_untrust] source-zone trust
[Device-vsysb-policy-security-rule-vsysb_trust_to_untrust] destination-zone untrust
[Device-vsysb-policy-security-rule-vsysb_trust_to_untrust] source-address 10.3.1.0 24
[Device-vsysb-policy-security-rule-vsysb_trust_to_untrust] destination-address 10.3.0.0 24
[Device-vsysb-policy-security-rule-vsysb_trust_to_untrust] action permit
[Device-vsysb-policy-security-rule-vsysb_trust_to_untrust] quit
配置untrust到trust的安全策略,放行网络A中的用户主动访问网络B的流量。
[Device-vsysb-policy-security] rule name vsysb_untrust_to_trust
[Device-vsysb-policy-security-rule-vsysb_untrust_to_trust] source-zone untrust
[Device-vsysb-policy-security-rule-vsysb_untrust_to_trust] destination-zone trust
[Device-vsysb-policy-security-rule-vsysb_untrust_to_trust] source-address 10.3.0.0 24
[Device-vsysb-policy-security-rule-vsysb_untrust_to_trust] destination-address 10.3.1.0 24
[Device-vsysb-policy-security-rule-vsysb_untrust_to_trust] action permit
[Device-vsysb-policy-security-rule-vsysb_untrust_to_trust] quit
[Device-vsysb-policy-security] quit
检查配置结果
•网络A中的用户可以主动访问网络B,同时,虚拟系统vsysa和虚拟系统vsysb中分别建立如下会话。
10.3.1.3是网络A中的用户访问的网络B中服务器的IP地址;10.3.0.2是网络A中用户主机的IP地址。
虚拟系统vsysa中的会话:
<Device> display firewall session table verbose vsys vsysa destination global 10.3.1.3
Current Total Sessions : 1
icmp VPN: vsysa --> vsysb ID: xxxxxxxxxxxxxxxxxxxxxx
Zone: trust --> untrust TTL: xx:xx:xx Left: xx:xx:xx
Interface: Virtual-if1 NextHop: 0.0.0.0 MAC: xxxx-xxxx-xxxx
<--packets: xxx bytes: xxx --> packets: xxx bytes: xxx
10.3.0.2:43999 --> 10.3.1.3:2048 PolicyName: vsysa_trust_to_untrust