日韩色av_久久99精品久久久久久国产越南_四虎激情_免费国产精品视频_久久免费福利视频_婷婷伊人综合中文字幕

路由器

當(dāng)前位置:首頁>IT運維>路由器
全部 17 路由器 17

防火墻后面的 tinc

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

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

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

tinc.png

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

內(nèi)部網(wǎng)絡(luò)為 123.234.123.0/24
防火墻 IP 為 123.234.123.1
運行 tinc 的主機有 IP 123.234.123.42
主機想要連接的 VPN 的地址范圍為 192.168.0.0/16
主機有自己的 VPN IP 192.168.10.20
請注意,內(nèi)部網(wǎng)絡(luò)具有真實的 Internet 地址,因此完全可以從外部訪問(防火墻設(shè)置的限制除外)。如果內(nèi)部網(wǎng)絡(luò)具有私有地址,請參考偽裝防火墻示例。

運行 tinc 的主機的配置
host# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:20:30:40:50:60
          inet addr:123.234.123.42  Bcast:123.234.123.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
123.234.123.0   *               255.255.255.0   U     0      0        0 eth0
192.168.0.0     *               255.255.0.0     U     0      0        0 vpn
default         123.234.123.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.42
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:123.234.123.1  Bcast:123.234.123.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
123.234.123.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     tcp  --  ppp0   eth0    anywhere             10.20.30.0/24      tcp flags:!SYN,RST,ACK/SYN
 1234 123K  ACCEPT     any  --  eth0   ppp0    10.20.30.0/24        anywhere
 1234 123K  ACCEPT     tcp  --  ppp0   eth0    anywhere             123.234.123.42     tcp dpt:655
 1234 123K  ACCEPT     udp  --  ppp0   eth0    anywhere             123.234.123.42     udp dpt:655

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

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

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 -d 10.20.30.0/24 -p tcp ! --syn
iptables -A FORWARD -j ACCEPT -i eth0 -s 10.20.30.0/24
iptables -A FORWARD -j ACCEPT -i ppp0 -o eth0 -d 123.234.132.42 -p tcp --dport 655
iptables -A FORWARD -j ACCEPT -i ppp0 -o eth0 -d 123.234.132.42 -p udp --dport 655


上一篇:創(chuàng)建橋接 tinc-vpn dhcp 系統(tǒng)以連接網(wǎng)絡(luò)段

下一篇:設(shè)置由 tinc 管理的 IPv6 網(wǎng)絡(luò)

發(fā)表評論:

評論記錄:

未查詢到任何數(shù)據(jù)!

在線咨詢

點擊這里給我發(fā)消息 售前咨詢專員

點擊這里給我發(fā)消息 售后服務(wù)專員

在線咨詢

免費通話

24小時免費咨詢

請輸入您的聯(lián)系電話,座機請加區(qū)號

免費通話

微信掃一掃

微信聯(lián)系
返回頂部
主站蜘蛛池模板: 97视频免费看 | 亚洲精品小视频 | 欧美一区二区三区激情视频 | 九色视频在线观看 | 午夜视频免费在线观看 | 日韩欧美视频在线 | 综合激情亚洲 | 国产三级精品三级在线观看 | 久久99久久久久久久久久久 | 午夜av影视 | 国产日韩在线视频 | 亚洲一级黄色 | 黄色小视频在线播放 | 麻豆精品久久 | 亚洲欧美日韩成人在线 | 日韩免费视频一区二区视频在线观看 | 看av网址| 国产精品色片 | 久久福利网站 | 亚洲成人av一区二区三区 | 在线观看一区二区三区视频 | 久久视频精品在线观看 | 男人天堂视频在线观看 | 找个毛片看看 | 黄色xxx | 爱看av在线 | 久草日韩 | av婷婷在线 | 欧美性猛交xxxx乱大交少妇 | 亚洲毛片网站 | 精品久久久久久久久久久久久久久久久 | 欧美第一页 | 亚洲三页 | 亚洲图色av | 中文字幕日韩av | 中文在线一区 | 亚洲热在线 | 91av官网 | 亚洲黄色网址 | 国产在线播放av | 欧美激情在线看 |