04
2024
01
11:29:13

如何将传统网络改造成SD-WAN?手工配置方案



推荐点击下面图片,通过本站淘宝优惠价购买:

image.png

假设有这样一张网络,其中RTA和PCA表示某公司的A分支,通过中国电信CT路由器接入互联网ISP;RTB和PCB表示某公司的B分支,通过中国联通CU路由器接入互联网ISP。DNS(8.8.8.8)表示某互联网应用。

c0158f09ba87f194c37e0c1230147b15_16480155991db73b.png


为实现A分支私网192.168.2.0/24和B分支私网192.168.3.0/24的互通,现计划使用某厂商的SD-WAN方案进打通两个内网,像下图这样简单变更一下网络。图中POP为某厂商SD-WAN方案用户接入点设备,分支侧通过接入CPE设备进行互通。为不改变现有网络结构,将CPE设备旁挂在分支的出口设备上,需要能够同时访问到内网和互联网即可,由CPE设备和POP设备建立隧道,进而实现内网互通。

这种架构的SD-WAN方案是目前实现比较简单的方案,对设备整体要求不高,只要支持IPsec即可,所以本案例主要也是通过IPsec来实现的。而且分支机构不需要具备公网IP地址,只要能访问互联网即可。

20743688e7021b301e064cede52133f5_1648015648a4ad8f.png

接下来就简单了,可以说是单纯的IPsec的配置。

POP

创建IKE keychain,并配置与两个CPE使用的预共享密钥为明文的qwe123。

#

ike keychain key1

 pre-shared-key hostname cpe1 key simple qwe123

 pre-shared-key hostname cpe2 key simple qwe123

创建IKE profile,指定密钥为key1,配置IKE第一阶段协商使用野蛮模式。指定使用IP地址(24.1.1.4)标识本端身份,指定需要匹配对端身份类型为名称cpe1和cpe2。

#

ike profile pro1

 keychain key1

 exchange-mode aggressive

 local-identity address 24.1.1.4

 match remote identity fqdn cpe1

 match remote identity fqdn cpe2

创建IPsec安全提议,ESP加密算法为aes-cbc-128,ESP认证算法为sha1。

#

ipsec transform-set tran1

 esp encryption-algorithm aes-cbc-128

 esp authentication-algorithm sha1

配置IPsec安全框架,通过IKE协商建立安全联盟。

#

ipsec profile sdwan isakmp

 transform-set tran1

 ike-profile pro1

创建模式为psec-p2mp的隧道接口Tunnel1,配置WAN口地址为接口的源端地址,并配置Tunnel1接口的IP地址。最后在IPsec隧道接口上应用IPsec安全框架sdwan。

#

interface Tunnel1 mode ipsec-p2mp

 ip address 11.1.1.1 255.255.255.0

 source 24.1.1.4

 tunnel protection ipsec profile sdwan

添加A分支到B分支的静态路由。

#

ip route-static 192.168.2.0 24 Tunnel1 11.1.1.2

ip route-static 192.168.3.0 24 Tunnel1 11.1.1.3

CPE1

创建IKE keychain,并配置与POP(地址为24.1.1.4)的对端使用的预共享密钥为明文的qwe123。

#

ike keychain key1

 pre-shared-key address 24.1.1.4 255.255.255.0 key simple qwe123

创建IKE profile,指定密钥为key1,配置IKE第一阶段协商使用野蛮模式,指定使用名称cpe1标识本端身份。指定需要匹配对端身份类型为IP地址,取值为24.1.1.4。

#

ike profile pro1

 keychain key1

 exchange-mode aggressive

 local-identity fqdn cpe1

 match remote identity address 24.1.1.4 255.255.255.0

创建IPsec安全提议,ESP加密算法为aes-cbc-128,ESP认证算法为sha1。

#

ipsec transform-set tran1

 esp encryption-algorithm aes-cbc-128

 esp authentication-algorithm sha1

配置IPsec安全框架,通过IKE协商建立安全联盟。

#

ipsec profile sdwan isakmp

 transform-set tran1

 ike-profile pro1

创建模式为IPsec的隧道接口Tunnel1,配置WAN口地址为接口的源端地址,配置POP地址为接口的目的端地址,并配置Tunnel1接口的IP地址。最后在IPsec隧道接口上应用IPsec安全框架sdwan。

#

interface Tunnel1 mode ipsec

 ip address 11.1.1.2 255.255.255.0

 source GigabitEthernet2/0

 destination 24.1.1.4

 tunnel protection ipsec profile sdwan

配置A分支到B分支的静态路由。

#

ip route-static 192.168.3.0 24 Tunnel1

ip route-static 4.4.4.0 24 Tunnel1

CPE2

配置同CPE1,不再赘述,直接上配置。

#

ike keychain key1

 pre-shared-key address 24.1.1.4 255.255.255.0 key simple qwe123

#

ike profile pro1

 keychain key1

 exchange-mode aggressive

 local-identity fqdn cpe2

 match remote identity address 24.1.1.4 255.255.255.0

#

ipsec transform-set tran1

 esp encryption-algorithm aes-cbc-128

 esp authentication-algorithm sha1

#

ipsec profile sdwan isakmp

 transform-set tran1

 ike-profile pro1

#

interface Tunnel1 mode ipsec

 ip address 22.1.1.2 255.255.255.0

 source GigabitEthernet2/0

 destination 24.1.1.4

 tunnel protection ipsec profile sdwan

#

ip route-static 192.168.2.0 24 Tunnel1

ip route-static 4.4.4.0 24 Tunnel1

接下来只要在路由器RTA和RTB上将去往对端私网流量的下一跳指向CPE就可以了。

RTA

#

ip route-static 192.168.3.0 24 192.168.2.10

RTB

#

ip route-static 192.168.2.0 24 192.168.3.10

验证配置

从PCA上测试访问PCB的情况。

f838c6a31a1c03783b1f94e8427ddf2b_16480160013e04ca.png

可以看到,访问正常,并且通过tracert查看转发路径,流量是先到网关,再到CPE1,再到POP,再到CPE2,最后到达目标主机PCB。

而且,此时是不影响访问互联网的,在私网互通的同时可以正常访问模拟的公网业务。

c409cb7a7791bf536f6506c30d1fd7fa_1648016011fe4f5d.png

查看隧道接口状态。

98e4fb0c78fa3fd33e73a04c54280630_16480160228800f3.png

查看当前IKE SA的信息。

27af1022107b35edd942a78c360bd5fc_16480160290dfd52.png

查看当前IPsec SA的信息。

00f0ccb627aa7b6c8a27fe79dcd2b3a9_16480160354d202e.png

可以看到POP上隧道对端的地址是分支的出口公网IP地址,而流量是全0的,也就是说,任何流量转发过来都会封装IPsec,这就是IPsec隧道的魅力所在。

如果要增加流量,只需要两端内网对应的增加路由就可以了。


本文链接:https://hqyman.cn/post/4765.html 非本站原创文章欢迎转载,原创文章需保留本站地址!

分享到:





休息一下,本站随机推荐观看栏目:


« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

您的IP地址是: