[size=18] 通过linux代理拨另外一台linux pptp VPN server的问题[/size]
我的winxp通过一台linux主机用iptables做NAT代理上网,连不上另一台linux的PPTP VPN Server,报619错误,我知道这个错误是GRE协议密码验证方面的问题,但是iptables改了几次都不行。
拓扑如下图
我的iptables规则
[root@gw root]# 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
[root@gw root]#
把所有的规则都去掉了,只留下
# 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的错误。
platinum 回复于:2005-06-16 14:06:04
引用:
而我直接用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 的那个机器上
ljily000 回复于:2005-06-17 13:32:03
Thanks !
收到,先试一试再说!
ljily000 回复于:2005-06-19 00:12:00
: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
[u]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[/u]
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 [N/y/t/f/a/r/b/w/q/?]
:em06:
不知道怎么会这样!原因ing
does NOT work with kernels >; 2.6.10 [/u] 真的是这样?[/u]
ljily000 回复于:2005-06-19 18:18:03
在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:
ljily000 回复于:2005-06-19 18:50:12
刚才又make menuconfig看了看,h323、ip2pp都上去了,就是没看到 ip_conntrack_proto_gre
ip_conntrack_pptp
ip_nat_proto_gre
ip_nat_pptp
NAT For PPTP? :em14:
ljily000 回复于:2005-06-21 16:58:06
搞不定啦,前辈哪一位做过的,给点提示!
netfilter的补丁打不上去!
platinum 回复于:2005-06-21 18:59:10
恩,刚收到你的站内短信时我还想,为什么打不上呢?
来到这里,看到你贴出相信信息后明白为什么了——你用的内核是 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 好,且有必要换的时候再换不迟,不要轻易随大流!
ljily000 回复于:2005-06-22 09:26:45
No,No,我并不是疯狂追潮流,我用的是FC2 是Linux 2.6.5-1.358的内核,我到www.kernel.org看了一下,找了一个最新的release的版本就download了,哈哈,想不到真的是内核的原因(看来最新的并不一定是最好的)!
谢谢!受教!
对内核真的还没什么研究,你这一番话还是受益匪浅的!
嗯,好的,重新装一个RH9试一试!
谢谢了!
platinum 回复于:2005-06-22 14:38:56
Fedroa 本身就是 RedHat 的一个试验项目啊
SunLife 回复于:2005-06-22 19:08:10
用2.6不一定就是疯狂追潮流。
2.6很多方面比2.4要强,不过也有好多地方要差
platinum 回复于:2005-06-25 06:43:23
恩,2.6 也有好的地方,主要就是性能上
我现在也刚刚开始对 2.6 进行测试
水若寒 回复于:2005-06-25 11:26:53
最新的2.6.12.1出来了.
platinum 回复于:2005-06-25 11:32:31
初次使用 2.6.X,感觉变化好大,我还不能驾驭。。。。
水若寒 回复于:2005-06-25 14:41:36
-------
jiangdaoyou 回复于:2005-08-15 19:58:55
你给iptables打ip_nat_pptp 补丁成功了吗?可否告诉一下???谢谢!重谢!!
jzh5188 回复于:2007-02-22 13:01:04
ip_conntrack_proto_gre
ip_conntrack_pptp
ip_nat_proto_gre
ip_nat_pptp
这些都打上了...还是不行....呀...
|