歡迎您光臨本站 註冊首頁

通過linux代理撥另外一台linux pptp VPN server的問題

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

通過linux代理撥另外一台linux pptp VPN server的問題

通過linux代理撥另外一台linux pptp VPN server的問題

我的winxp通過一台linux主機用iptables做NAT代理上網,連不上另一台linux的PPTP VPN Server,報619錯誤,我知道這個錯誤是GRE協議密碼驗證方面的問題,但是iptables改了幾次都不行。
拓撲如下圖
我的iptables規則
# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ftp
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ftp-data
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:1723
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:4500
ACCEPT     gre  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:55558
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:55555
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:55556
ACCEPT     icmp --  anywhere             anywhere            icmp !echo-request
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
DROP       all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
#


把所有的規則都去掉了,只留下
# VPN
/sbin/iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
/sbin/iptables -A INPUT -p tcp --dport 4500 -j ACCEPT
/sbin/iptables -A INPUT -p gre -j ACCEPT

也不行!
而我直接用winxp接adsl modem撥號,可以連上VPN,比較正常,只有是通過linux 代理就不行,會報651和619的錯誤。
《解決方案》

通過linux代理撥另外一台linux pptp VPN server的問題


而我直接用winxp接adsl modem撥號,可以連上VPN,比較正常,只有是通過linux 代理就不行,會報651和619的錯誤

恩,看來你需要給 netfilter 打個補丁,需要重編 iptables,把 pptp-conntrack-nat 打進去
http://www.netfilter.org/patch-o-matic/pom-extra.html#pom-extra-pptp-conntrack-nat

補丁打在做 NAT 的那個機器上
《解決方案》

通過linux代理撥另外一台linux pptp VPN server的問題

Thanks !
收到,先試一試再說!
《解決方案》

通過linux代理撥另外一台linux pptp VPN server的問題

:em16:  極度鬱悶中。。。 :(   

./runme  --batch --kernel-path=/usr/sr
c/linux-2.6.11.12  --iptables-path=/root/file/iptables-1.3.1 extra
給給netfilter打補丁時

出現如下提示
-------------------------------------------------------
Already applied: CLASSIFY SAME addrtype comment hashlimit ownercmd realm sctp HOPLIMIT IPV4OPTSSTRIP NETMAP REJECT TTL connlimit fuzzy iprange ipv4options nth osf psd quota set time u32 IPMARK ROUTE TARPIT ULOG XOR account conntrack-event-api nfnetlink ctnetlink geoip h323-conntrack-nat ip_queue_vwmark ipp2p mms-conntrack-nat policy

Testing pptp-conntrack-nat... not applied
The pptp-conntrack-nat patch:
   Author: Harald Welte <laforge@netfilter.org>;
   Status: Testing, especially the 2.6.x port

This adds CONFIG_IP_NF_PPTP:
Connection tracking and NAT support for PPTP.  Using this, you can track
PPTP/GRE connections and do SNAT/DNAT.  You have to load the following modules
for connection tracking:
        ip_conntrack_proto_gre
        ip_conntrack_pptp
for NAT:
        ip_nat_proto_gre
        ip_nat_pptp

The GRE connection is marked as RELATED to the TCP session on port 1723, so all
you need is something like

iptables -j ACCEPT -m state --state RELATED,ESTABLISHED
iptables -j ACCEPT -d my_pptp_server -p tcp --dport 1723 -m state --state NEW


Note that this code currently has limitations
- can only NAT connections from PNS to PAC
- doesnt' support multiple calls within one session
- you have to recompile your iptables userspace program since some
  structure sizes change
- does NOT work with kernels >; 2.6.10   
unable to find ladd slot in src /tmp/pom-21160/include/linux/netfilter_ipv4/ip_conntrack.h (./pptp-conntrack-nat/linux-2.6.11/./include/linux/netfilter_ipv4/ip_conntrack.h.ladd_6)
-----------------------------------------------------------------
Do you want to apply this patch

  :em06:

不知道怎麼會這樣!原因ing
does NOT work with kernels >; 2.6.10    真的是這樣?
《解決方案》

通過linux代理撥另外一台linux pptp VPN server的問題

在netfilter.org上的解釋:
http://www.netfilter.org/documentation/HOWTO//netfilter-extensions-HOWTO-2.html   

p-o-m will go through most of the patches. If they are already applied, you will see so on the `Already applied:' first line. If they are not applied yet, it will display the name of the patch with some explanations. p-o-m will tell you what is going on : `NOT APPLIED ( n missing files)' simply means the patch has not been applied yet, whereas `NOT APPLIED ( n rejects out of n hunks)' generally means that :

Either the patch cannot be applied cleanly...
...Or the patch has already been included in the kernel you are trying to patch.

難道是kernel已經包含patch?
但是make menuconfig時在filter里看不到
ip_conntrack_proto_gre
       ip_conntrack_pptp
       ip_nat_proto_gre
       ip_nat_pptp
這些內容。

iptables source和kernel的path不對?也應該不可能檢查了幾遍了,沒錯。
真的不知道什麼原因 :em06:  :em14:
《解決方案》

通過linux代理撥另外一台linux pptp VPN server的問題

剛才又make menuconfig看了看,h323、ip2pp都上去了,就是沒看到 ip_conntrack_proto_gre
       ip_conntrack_pptp
       ip_nat_proto_gre
       ip_nat_pptp

NAT For PPTP? :em14:
《解決方案》

通過linux代理撥另外一台linux pptp VPN server的問題

搞不定啦,前輩哪一位做過的,給點提示!

netfilter的補丁打不上去!
《解決方案》

通過linux代理撥另外一台linux pptp VPN server的問題

恩,剛收到你的站內簡訊時我還想,為什麼打不上呢?
來到這裡,看到你貼出相信信息后明白為什麼了——你用的內核是 2.6.x

netfilter 的 patch 對 2.6.x 的支持不好,很多非常有用的東西在 2.4.x 上面沒事,但 2.6.x 上面用不了

加上一些其他原因,比如 2.6.x 不穩定(某些特定功能不支持,或 kernel panic),2.6.x 並沒有體現出比 2.4.x 好在哪裡(至少我感覺)等,這也就是我一直沒敢碰 2.6.x 內核的原因

這裡我想說句話,很多人瘋狂追潮流,喜歡用 2.6.x 的內核,說 2.6.x 好,我沒有看到,我看到的種種只是 2.6.x 比 2.4.x 不好的地方,我比較保守,因此我一直沿用 2.4.x 的內核,也從來沒遇到過什麼問題,當然我說的可能不對,歡迎大家拍磚:)

TO ljly000兄,如果你有時間,再試一下 2.4.x 如何?
個人建議,當你真的認為 2.6.x 比 2.4.x 好,且有必要換的時候再換不遲,不要輕易隨大流!
《解決方案》

通過linux代理撥另外一台linux pptp VPN server的問題

No,No,我並不是瘋狂追潮流,我用的是FC2 是Linux 2.6.5-1.358的內核,我到www.kernel.org看了一下,找了一個最新的release的版本就download了,哈哈,想不到真的是內核的原因(看來最新的並不一定是最好的)!
謝謝!受教!
對內核真的還沒什麼研究,你這一番話還是受益匪淺的!
嗯,好的,重新裝一個RH9試一試!

謝謝了!
《解決方案》

通過linux代理撥另外一台linux pptp VPN server的問題

Fedroa 本身就是 RedHat 的一個試驗項目啊

[火星人 ] 通過linux代理撥另外一台linux pptp VPN server的問題已經有734次圍觀

http://coctec.com/docs/service/show-post-12210.html