为了路由目的,我需要将IPv4封装在IPv6中。一端是运行quagga的Linux盒,另一端是Mikrotik CCR2004。多么?
发布于 2021-02-12 08:45:33
我们将为此使用PSK标识,因为它是点对点链接,没有理由用证书使其复杂化。这适用于Ubuntu20.04和RouterOS 6.48.1。
在Mikrotik方面,只需这样做(真正的挑战是让Strongswan对齐)。如果您将默认的IPSec配置文件用于其他用途,则不能像我这样配置它,除非每个人都可以使用相同的安全规范。
/ip ipsec proposal change 0 auth-algorithms=sha512 enc-algorithms=aes-256-cbc pfs-group=ecp521
/ip ipsec profile change 0 hash-algorithm=sha512 enc-algorithm=aes-256 dh-group=ecp521 nat-traversal=no
/interface gre6 add name=gre-whatever local-address=2002:1234::1 remote-address=2002:4321::1 ipsec-secret=changeme在Linux中安装GRE隧道:
ip -6 tunnel add gre.wat remote 2002:1234::1 local 2002:4321::1对于strongswan,请设置/etc/ipsec.secrets:
2002:1234::1 2002:4321::1 : PSK changeme对于/etc/ipsec.conf:
conn sea1
fragmentation=yes
keyexchange=ike
authby=secret
ike=aes256-sha2_512-ecp521!
esp=aes256-sha2_512-ecp521!
left=2002:4321::1
leftid=2002:4321::1
leftsubnet=%dynamic[gre]
right=2002:1234::1
rightid=2002:1234::1
rightsubnet=%dynamic[gre]
auto=route
type=transport现在,您可以在隧道的两端配置IPv4地址,并且它们将以1390的MTU通过隧道(除非您去启用MTU=9000)。
发布于 2021-06-03 03:48:55
类似于Falcom上面发布的内容,您可以找到我在各种VPN程序上完成的整个wiki页面,并在这里链接到https://wiki.pttlink.org/wiki/VPN。
我在IPSEC下有一节涉及到strongSwan到MikroTik链接。
以下是本节的内容:
下面的配置将在安装了FreeBSD或Linux的strongSwan系统上运行。
注意:您也可以使用此配置连接两个非MikroTik系统。只需为您希望连接的每个系统复制下面的配置即可。
/etc/ipsec.conf:
conn <name>
authby=secret
auto=route
keyexchange=ike
left=<your local IP>
right=<remote IP of Mikrotik system>
leftikeport=500
rightikeport=500
type=transport
ike=aes256-sha1-modp1024!
esp=aes256-sha1!
dpddelay=5
dpdtimeout=20
dpdaction=clear/etc/ipsec.secrets.秘密:
<your local IP> <remote IP of Mikrotik system> : PSK "<Put your preshared key here>"下面的配置最好是在MikroTik设备上的终端上完成。
注意:您可以使用以下配置连接两个MikroTik系统。只需在您希望连接的每个系统上复制下面的配置即可。
/ip ipsec policy
add src-address=0.0.0.0/0 dst-address=<remote IP of strongswan system> proposal=ike2 ipsec-protocols=esp
/ip ipsec proposal
add name="ike2" auth-algorithms=sha256,sha1 enc-algorithms=aes-256-cbc,aes-128-cbc lifetime=30m pfs-group=none
/ip ipsec peer
add name="<name of strongswan system>" address=<local IP> profile=ike2 exchange-mode=main send-initial-contact=yes
/ip ipsec identity
add peer=<remote IP of strongswan system> auth-method=pre-shared-key secret="<Put your preshared key here>" generate-policy=no
/ip ipsec profile
add name="ike2" hash-algorithm=sha1 enc-algorithm=aes-256,aes-192,aes-128,3des,des dh-group=modp2048,modp1024 lifetime=8h proposal-check=obey nat-traversal=no dpd-interval=2m dpd-maximum-failures=5https://serverfault.com/questions/1053383
复制相似问题