互联网高级白领孵化基地

技术论坛

配置企业间通过WAN网络+Internet互联示例

更新时间:2022-09-21

配置注意事项

适用于V200R003C00及其后续版本的AR路由器。

AR120系列不支持WLAN AC功能。

组网需求

如图1-1所示,企业A有设计部、财务部、市场部和生产部等部门,企业A以RouterA作为出口网关,上行通过WAN网络或Internet接入合作伙伴企业B,下行通过Switch或FIT AP接入各个部门的主机。企业B以RouterB作为出口网关。

图1-1 配置企业间通过WAN网络+Internet互联

企业A有如下需求:

l   设计部、财务部、市场部和生产部之间不能二层互通,以避免广播风暴。

l   正常情况下,企业A经由WAN网络与企业B相互通信,当WAN链路出现故障导致通信中断时,企业希望流量能够立即从WAN网络切换到Internet。

l   企业A经由Internet与企业B相互通信时,企业A希望能保证数据安全和私密性。

l   生产部的员工使用无线网络与企业B进行通信。

配置思路

为了满足企业上述需求,采用如下思路配置RouterA:

l   将设计部、财务部、市场部和生产部加入不同的VLAN,实现不同部门间二层流量隔离。

l   配置两条静态路由,一条静态路由指向WAN网络,另一条指向Internet,并且指向WAN网络的静态路由的优先级高于指向Internet的静态路由的优先级,这样,流量正常情况下经由WAN网络传输到企业B。接着在RouterA上配置BFD检测WAN链路的联通状态,这样,当WAN链路出现故障导致通信中断,流量会立即从WAN网络切换到Internet。

l   配置IPSec VPN功能,对经由Internet传输到企业B的流量进行安全保护。

l   配置WLAN AC功能,提供名为“product”的无线网络,使生产部的员工使用无线网络与企业B进行通信。

配置文件

l   RouterA的配置文件

#

 sysname RouterA

#

vlan batch 10 20 30 40 50     //创建VLAN

#                                                                               

dhcp enable                  //使能DHCP功能

#

bfd                          //使能BFD功能

#

bfd atob bind peer-ip default-ip interface Serial1/0/0    //配置组播BFD,对链路Serial1/0/0进行检测

 discriminator local 1

 discriminator remote 2

 commit

#

acl number 3002    //创建高级ACL,定义企业A的网段

 rule 5 permit ip source 10.10.0.0 0.0.255.255

acl number 3101    //创建高级ACL,定义从企业A发往企业B的流量

 rule 5 permit ip source 10.10.0.0 0.0.255.255 destination 10.11.0.0 0.0.255.255

#

ipsec proposal tran1    //配置IPSec安全提议

 esp authentication-algorithm sha2-256 

 esp encryption-algorithm aes-128 

#

ike proposal 5         //配置IKE安全提议

 encryption-algorithm aes-cbc-128         

 authentication-algorithm sha2-256 

#

ike peer spub v1                //配置IKE对等体,并在IKE对等体视图下配置预共享密钥、IKE安全提议和对端的IP地址

 pre-shared-key cipher %^%#JvZxR2g8c;a9~FPN~n'$7`DEV&=G(=Et02P/%*!%^%#

 ike-proposal 5

 remote-address 3.3.3.3

#

ipsec policy map1 10 isakmp    //配置IKE动态协商方式安全策略

 security acl 3101

 ike-peer spub

 proposal tran1

#

interface Vlanif10        //创建VLANIF接口

 ip address 10.10.10.1 255.255.255.0

 dhcp select interface    //使能采用接口地址池的DHCP服务器功能,为设计部的员工分配IP地址

#

interface Vlanif20       //创建VLANIF接口

 ip address 10.10.20.1 255.255.255.0

 dhcp select interface    //使能采用接口地址池的DHCP服务器功能,为财务部的员工分配IP地址

#

interface Vlanif30      //创建VLANIF接口

 ip address 10.10.30.1 255.255.255.0

 dhcp select interface     //使能采用接口地址池的DHCP服务器功能,为市场部的员工分配IP地址

#

interface Vlanif40      //创建VLANIF接口

 ip address 10.10.40.1 255.255.255.0

 dhcp select interface    //使能采用接口地址池的DHCP服务器功能,为生产部的员工分配IP地址

#

interface Vlanif50     //创建VLANIF接口

 ip address 10.10.50.1 255.255.255.0

 dhcp select interface    //使能采用接口地址池的DHCP服务器功能,为FIT AP分配IP地址

#

interface Ethernet0/0/1    

 port link-type trunk

 port trunk allow-pass vlan 10     //配置以太接口加入VLAN10

#

interface Ethernet0/0/2

 port link-type trunk

 port trunk allow-pass vlan 20    //配置以太接口加入VLAN20

#

interface Ethernet0/0/3

 port link-type trunk

 port trunk allow-pass vlan 30    //配置以太接口加入VLAN30

#

interface Ethernet0/0/4

 port link-type trunk

 port trunk allow-pass vlan 40 50    //配置以太接口加入VLAN40和VLAN50

 port-isolate enable                 //配置端口隔离,避免不同AP间的WLAN用户二层互通

#                                                                               

interface GigabitEthernet2/0/0   

 ip address 2.2.2.2 255.255.255.0    

 ipsec policy map1         //在接口上引用安全策略组

#                                                                               

interface Serial1/0/0                                                           

 link-protocol ppp   

 ip address 1.1.1.1 255.255.255.0

 nat outbound 3002         //配置NAT功能

#

interface Wlan-Ess1       //创建WLAN ESS接口

 port hybrid pvid vlan 40

 port hybrid tagged vlan 40          //配置WLAN ESS接口加入VLAN40

capwap source interface vlanif50     //配置AC与AP建立CAPWAP隧道的源接口。

#   

wlan ac                             //配置WLAN AC功能

 ap-region id 10

 ap id 0 type-id 19 mac 60de-4476-e360 sn 210235419610CB002287

  region-id 10

 wmm-profile name wmm id 1

 traffic-profile name traffic id 1

 security-profile name security id 1                                             

  security-policy wpa2                                                          

  wpa2 authentication-method psk pass-phrase cipher %@%@0MqY9X~eYpe}1;2439e"2P

%@%@ encryption-method ccmp   

 service-set name product id 1

  wlan-ess 1

  ssid product           //设置无线网络名称为product

  traffic-profile id 1

  security-profile id 1

  service-vlan 40        //设置业务VLAN为VLAN40

 radio-profile name radio id 1

  wmm-profile id 1

 ap 0 radio 0

  radio-profile id 1

  service-set id 1 wlan 1

#

ip route-static 0.0.0.0 0.0.0.0 Serial1/0/0 preference 40             //配置指向WAN网络的缺省路由

ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet2/0/0 preference 80    //配置指向Internet的缺省路由

#

return

l   RouterB的配置文件

#

 sysname RouterB

#

acl number 3002            //创建高级ACL,定义企业B的网段

 rule 5 permit ip source 10.11.0.0 0.0.255.255

acl number 3101            //创建高级ACL,定义从企业A发往企业B的流量

 rule 5 permit ip source 10.11.0.0 0.0.255.255 destination 10.10.0.0 0.0.255.255

#

ipsec proposal tran1   //配置IPSec安全提议

 esp authentication-algorithm sha2-256 

 esp encryption-algorithm aes-128 

#

ike proposal 5        //配置IKE安全提议

 encryption-algorithm aes-cbc-128         

 authentication-algorithm sha2-256 

#

ike peer spua v1     //配置IKE对等体,并在IKE对等体视图下配置预共享密钥、IKE安全提议和对端的IP地址

 pre-shared-key cipher %^%#K{JG:rWVHPMnf;5|,GW(Luq'qi8BT4nOj%5W5=)%^%#

 ike-proposal 5

 remote-address 2.2.2.2   

#

ipsec policy use1 10 isakmp     //配置IKE动态协商方式安全策略

 security acl 3101

 ike-peer spua

 proposal tran1

#

interface GigabitEthernet2/0/0

 ip address 3.3.3.3 255.255.255.0

 ipsec policy use1             //在接口上引用安全策略组

#                                                                               

interface Serial1/0/0                                                            

 link-protocol ppp   

 ip address 1.1.1.2 255.255.255.0

 nat outbound 3002    //配置NAT功能

#

ip route-static 0.0.0.0 0.0.0.0 Serial1/0/0 preference 40        //配置指向WAN网络的缺省路由

ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet2/0/0 preference 80         //配置指向Internet的缺省路由

#

return