麻豆一区二区-男人的天堂在线-精品视频免费观看-男男在线-超碰97av-国产一级网站-亚洲成人动漫在线观看-九九精品视频在线-偷拍视频一区-国产精品看片-久久91av-午夜男人网-日本特黄一级-亚洲专区第一页-夜夜高潮夜夜爽国产伦精品-久久精品国产亚洲av久-狠狠躁躁夜夜躁波多野结依-精品字幕-玉米地弄刘寡妇尖叫-草逼导航-青青伊人av-av直播在线观看-电影av在线-亚洲五月网-国产精品综合久久久-欧美一级黄色片视频-日韩在线视频在线观看-97久久国产亚洲精品超碰热-亚洲丝袜天堂-直播一级片

聯(lián)系電話: 18171260050

技術(shù)文檔

  • 13,Nov,2024

tinc 位于偽裝的防火墻后面

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

示例:偽裝防火墻后面的 tinc
概述
運(yùn)行 tinc 的主機(jī)的配置
tinc 的配置
防火墻配置
概述

武漢IT外包


網(wǎng)絡(luò)設(shè)置如下:

內(nèi)部網(wǎng)絡(luò)是 10.20.30.0/24
防火墻IP外部為123.234.123.1,內(nèi)部為10.20.30.1/24。
運(yùn)行 tinc 的主機(jī)有 IP 10.20.30.42
主機(jī)想要連接的 VPN 的地址范圍為 192.168.0.0/16
主機(jī)有自己的 VPN IP 192.168.10.20
運(yùn)行 tinc 的主機(jī)的配置
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

主站蜘蛛池模板: 国精产品乱码一区一区三区四区 | 婷婷五月花 | 亚洲色图综合 | 久草福利视频 | 国产麻豆剧传媒精品国产av | 国产精品一品二区三区的使用体验 | 日本孕妇孕交 | 欧美日韩中文 | 中文字幕日韩人妻在线视频 | 日韩一级| 草莓污视频 | 黄色美女网站 | 特黄老太婆aa毛毛片 | 色欲狠狠躁天天躁无码中文字幕 | 日本三级视频 | 男女啪啪网站 | 亚洲午夜精品久久久久久人妖 | 日韩一区二区在线观看 | 美女被草| 欧美影院 | 国产黄色在线观看 | 尤物视频在线观看 | 国产亚洲精品码 | 黄色91| 一区二区三区在线观看视频 | 国产a级片 | 亚洲成色www.777999 | 姐妹 5| a级片网站 | 日韩精品在线播放 | 日韩黄色大片 | 国精产品一区一区三区 | 成人黄色大片 | 黄色三级视频 | 尤物视频在线 | 日韩av免费| 在线免费观看 | 久久午夜视频 | 成人久久久 | 小婷的性泛滥日记h | 先锋av资源 | 两性囗交做爰视频 | 国产又黄又爽 | 天天射天天干 | 亚洲精品一区二区三区四区高清 | 欧美一级在线观看 | 成人av影院 | 日韩av一区二区三区 |