亚洲精品乱码久久久久久蜜桃动漫 I 亚洲欧美aa I 懂色av,蜜臀av粉嫩av I 成年人视频免费在线 I jizz日本大全 I 国产资源免费在线观看 I 成人看片黄a免费看 I 中文字幕成人动漫 I 亚洲有吗在线观看 I 99福利 I 日本免费高清视频 I 免费激情片 I 另类亚洲综合区图片小说区 I 中文字幕第99页 I 另类中文字幕 I 免费色婷婷 I 曰韩中文字幕 I 自拍偷拍日韩精品 I 成人夜色av I 无码精品国产va在线观看dvd I 国产熟妇另类久久久久 I 日本久久中文 I 久久久久久久久久av I 色四月 I 亚洲第一成网站 I 日产精品1区2区3区 I 国产李沁av在线播放 I 久久精品成人免费观看 I 日韩精品视频观看 I 成人免费视频免费观看 I 亚洲一区二区三区免费 I 欧美xxxx精品 I 婷婷丁香色

路由器

當前位置:首頁>IT運維>路由器
全部 17 路由器 17

tinc 位于偽裝的防火墻后面

時間:2025-03-24   訪問量:1304

示例:偽裝防火墻后面的 tinc
當在偽裝防火墻后面(而不是在防火墻本身上)運行 tinc 時,必須小心配置防火墻,以便允許 tinc 流量通過而不改變源端口和目標端口。此示例中包含示例防火墻規則。它們是為 iptables(Linux 2.4 防火墻代碼)編寫的,但已注釋,以便您可以將相同類型的規則應用于其他防火墻。

示例:偽裝防火墻后面的 tinc
概述
運行 tinc 的主機的配置
tinc 的配置
防火墻配置
概述


網絡設置如下:

內部網絡是 10.20.30.0/24
防火墻IP外部為123.234.123.1,內部為10.20.30.1/24。
運行 tinc 的主機有 IP 10.20.30.42
主機想要連接的 VPN 的地址范圍為 192.168.0.0/16
主機有自己的 VPN IP 192.168.10.20
運行 tinc 的主機的配置
host# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:20:30:40:50:60
          inet addr:10.20.30.42  Bcast:10.20.30.255  Mask:255.255.255.0
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          ...

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:3856  Metric:1
          ...

vpn       Link encap:Point-to-Point Protocol
          inet addr:192.168.10.20  P-t-P:192.168.10.20  Mask:255.255.0.0
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          ...

host# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.20.30.0      *               255.255.255.0   U     0      0        0 eth0
192.168.0.0     *               255.255.0.0     U     0      0        0 vpn
default         10.20.30.1      0.0.0.0         UG    0      0        0 eth0

host# iptables -L -v
Chain INPUT (policy ACCEPT 1234 packets, 123K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 2161K packets, 364M bytes)
 pkts bytes target     prot opt in     out     source               destination

host# iptables -L -v -t nat
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
tinc 的配置
host# cat /etc/tinc/vpn/tinc.conf
Name = atwork
ConnectTo = home

host# cat /etc/tinc/vpn/tinc-up
#!/bin/sh

ifconfig $INTERFACE 192.168.10.20 netmask 255.255.0.0

host# ls /etc/tinc/vpn/hosts
atwork  home

host# cat /etc/tinc/vpn/hosts/atwork
Address = 123.234.123.1
Subnet = 192.168.10.20/32
-----BEGIN RSA PUBLIC KEY-----
...
-----END RSA PUBLIC KEY-----

host# cat /etc/tinc/vpn/hosts/home
Address = 200.201.202.203
Subnet = 192.168.1.0/24
-----BEGIN RSA PUBLIC KEY-----
...
-----END RSA PUBLIC KEY-----
防火墻配置
firewall# ifconfig
ppp0      Link encap:Point-to-Point Protocol
          inet addr:123.234.123.1  P-t-P:123.234.120.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          ...

eth0      Link encap:Ethernet  HWaddr 00:20:13:14:15:16
          inet addr:10.20.30.1  Bcast:10.20.30.255  Mask:255.255.255.0
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          ...

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:3856  Metric:1
          ...

firewall# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.20.30.0      *               255.255.255.0   U     0      0        0 eth0
default         123.234.120.1   0.0.0.0         UG    0      0        0 ppp0

firewall# iptables -L -v
Chain INPUT (policy ACCEPT 1234 packets, 123K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy DROP 1234 packets, 123K bytes)
 pkts bytes target     prot opt in     out     source               destination
 1234  123K ACCEPT     any  --  ppp0   eth0    anywhere             10.20.30.0/24
 1234  123K ACCEPT     any  --  eth0   ppp0    10.20.30.0/24        anywhere

Chain OUTPUT (policy ACCEPT 2161K packets, 364M bytes)
 pkts bytes target     prot opt in     out     source               destination

firewall# iptables -L -v -t nat
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
 1234  123K DNAT       tcp  --  ppp0   any     anywhere             anywhere           tcp dpt:655 to:10.20.30.42:655
 1234  123K DNAT       udp  --  ppp0   any     anywhere             anywhere           udp dpt:655 to:10.20.30.42:655

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
 1234  123K MASQUERADE all  --  eth0   ppp0    anywhere             anywhere

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

firewall# cat /etc/init.d/firewall
#!/bin/sh

echo 1 >/proc/sys/net/ipv4/ip_forward

iptables -P FORWARD DROP
iptables -F FORWARD
iptables -A FORWARD -j ACCEPT -i ppp0 -o eth0 -d 10.20.30.0/24
iptables -A FORWARD -j ACCEPT -i eth0 -o ppp0 -s 10.20.30.0/24

iptables -t nat -F POSTROUTING
# Next rule prevents masquerading from altering source port of outbound tinc packets
iptables -t nat -A POSTROUTING -p udp -m udp --sport 655 -j MASQUERADE -o ppp0 --to-ports 655
iptables -t nat -A POSTROUTING -j MASQUERADE -o ppp0

iptables -t nat -F PREROUTING
# Next two rules forward incoming tinc packets to the host behind the firewall running tinc
iptables -t nat -A PREROUTING -j DNAT -i ppp0 -p tcp --dport 655 --to 10.20.30.42:655
iptables -t nat -A PREROUTING -j DNAT -i ppp0 -p udp --dport 655 --to 10.20.30.42:655


上一篇:設置由 tinc 管理的 IPv6 網絡

下一篇:偽裝防火墻上的 tinc

發表評論:

評論記錄:

未查詢到任何數據!

在線咨詢

點擊這里給我發消息 售前咨詢專員

點擊這里給我發消息 售后服務專員

在線咨詢

免費通話

24小時免費咨詢

請輸入您的聯系電話,座機請加區號

免費通話

微信掃一掃

微信聯系
返回頂部
主站蜘蛛池模板: 人人妻人人做人人爽夜欢视频 | 久久这里精品国产99丫e6 | 特级无码毛片免费视频播放 | 国产偷国产偷精品高清尤物 | 中文字幕无码专区人妻制服 | 乱妇乱女熟妇熟女网站 | 一本大道东京热无码一区 | 91福利免费观看 | 亚洲精品沙发午睡系列 | 偷偷做久久久久免费网站 | 亚洲国产日韩欧美一区二区三区 | 好紧好湿好黄的视频 | 中国少妇内射xxxxⅹhd | 最新国产精品久久精品 | 人妻夜夜爽天天爽三区丁香花 | 久久久国产99久久国产久一 | 国产中出视频 | 另类专区国产在线视频 | 久久久久综合一区二区不卡 | 无码国产精品一区二区免费式影视 | 国产人妻无码一区二区三区免费 | 国产精品亚洲二区在线播放 | 亚洲最新无码中文字幕久久 | 亚洲最大的熟女水蜜桃av网站 | 中文字幕有码在线视频 | 嫖妓丰满肥熟妇在线精品 | 国产电影无码午夜在线播放 | 夜夜躁狠狠躁日日躁视频 | 国产精品久久久久秋霞鲁丝 | 中文字幕亚洲无 | 国产精品aⅴ视频在线播放 极品粉嫩国产18尤物在线观看 | 国产在线观看www污污污 | 2023国产精品一卡2卡三卡4卡 | 无码人妻丰满熟妇啪啪网站 | 国产欧美日韩在线观看一区二区 | 91精品国产经典在线 | 国产女爽爽精品视频天美传媒 | 四虎永久在线精品无码视频 | 内射人妻少妇无码一本一道 | 中文在线天堂网www 失禁大喷潮在线播放 | 国产精品无码久久一线 |