跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • 请教一个配置 iptables 允许转发 L2tp over ipsec 问题
未分類
15 5 月 2020

请教一个配置 iptables 允许转发 L2tp over ipsec 问题

请教一个配置 iptables 允许转发 L2tp over ipsec 问题

資深大佬 : kaminic 8

家里一台 nas 做旁路由用

nas: 192.168.1.66

主路由: 192.168.1.1

nas 的 iptables 配置为:

iptables -t nat -N TP iptables -t nat -A TP -d 192.168.1.0/16 -j RETURN iptables -t nat -A TP -d 172.16.0.0/20 -j RETURN iptables -t nat -A TP -d 10.0.0.0/24 -j RETURN iptables -t nat -A TP -p tcp -j REDIRECT --to-ports 7892 iptables -t nat -A PREROUTING -p tcp -j TP 

PC 上设置网关为 nas 的地址,此时可以正常上网, 但是 PC 上原来正常的 VPN 不能正常连接了,把网关改会主路由的地址就没问题

是需要在 nas 里配置 iptables 转发 l2tp 相关协议数据吗?如何配置?

大佬有話說 (1)

  • 資深大佬 : pubby

    我们一台 VPN 网关用来屏蔽一些不走 ipsec 的 l2tp 客户端,仅供参考:

    # drop unencrypted L2TP connection
    /sbin/iptables -A INPUT -i eth0 -p udp –dport 1701 -m policy –dir in –pol ipsec -j ACCEPT >>/dev/null 2>&1
    /sbin/iptables -A INPUT -i eth0 -p udp –dport 1701 -j DROP >>/dev/null 2>&1

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具