Skip to contentSkip to conversation

Iptables do nat with Protocol 47 or GRE

DISCUSSION Sez 3 participants 14 messages May 14, 2004

lore
Share & tools
lore

Sez

author
#0 lore raw

Hi people,

I have a a vpn server in my Intranet. If i want access to this server i will pass my firewall.

The diagram is

VPN_CLIENT(W2k box) ---- router ---- (192.168.55.94 eth0) FIREWALL (192.168.55.95 eth1)-------- (192.168.55.92)VPN_SERVER

I create all iptables rules and VPN_CLIENT can connect to server. One client go well. But if another client try to connect he has this error
*** error 721: Remote server don't response. ***

I see in the log file that all packets from second client was dropped. And first client go well his connection.

Here are my important iptables rules:

iptables -t nat -A PREROUTING -s 0.0.0.0/0 -d 192.168.55.94 -p TCP --dport 1723 -j DNAT --to 192.168.55.92:1723
iptables -t nat -A PREROUTING -s 0.0.0.0/0 -d 192.168.55.94 -p GRE -j DNAT --to 192.168.55.92

iptables -t nat -A POSTROUTING -p TCP -s 0.0.0.0/0 -d 192.168.55.92 --dport 1723 -o eth1 -j MASQUERADE
iptables -t nat -A POSTROUTING -p GRE -s 0.0.0.0/0 -d 192.168.55.92 -o eth1 -j MASQUERADE

And other rules...

I receive packet

	 SOURCE --> IP_VPN_CLIENT 
	DESTINATION --> 192.168.55.94

	and I forward all packets and change ip source and ip destination.

Firewall out

	SOURCE --> 192.168.55.95
	DESTINATION--> 192.168.55.92

I also do the same to return de packet. I change the ip source, because VPN_SERVER has another gateway, it don't have Firewall with GATEWAY.

Don't Iptables have nat with differents gre connections??? Or have I some errors?
Thanks!

SERGI

#1 lore raw
Quoted 5 lines · Sez

Hi people,

I have a a vpn server in my Intranet. If i want access to this server i will pass my firewall.

Quoted 8 lines

The diagram is

VPN_CLIENT(W2k box) ---- router ---- (192.168.55.94 eth0) FIREWALL (192.168.55.95 eth1)-------- (192.168.55.92)VPN_SERVER

I create all iptables rules and VPN_CLIENT can connect to server. One client go well. But if another client try to connect he has this error
*** error 721: Remote server don't response. ***

Are you using the PPTP NAT connection tracking helper module? If not, you
will not be able to support more than one connection at a time.

Regards,

Antony.

Signature · 9 lines
There are two possible outcomes:

 If the result confirms the hypothesis, then you've made a measurement.
 If the result is contrary to the hypothesis, then you've made a discovery.

 - Enrico Fermi

                                                     Please reply to the list;
                                                           please don't CC me.
author
#2 lore raw

How can i know if i use connection trackink helper module?? Where can i obtain this?

-----Mensaje original-----
De: [email protected] [mailto:[email protected]] En nombre de Antony Stone Enviado el: divendres, 14 / maig / 2004 12:40
Para: [email protected]
Asunto: Re: Iptables do nat with Protocol 47 or GRE

Quoted 5 lines · Sez

Hi people,

I have a a vpn server in my Intranet. If i want access to this server i will pass my firewall.

Quoted 8 lines

The diagram is

VPN_CLIENT(W2k box) ---- router ---- (192.168.55.94 eth0) FIREWALL (192.168.55.95 eth1)-------- (192.168.55.92)VPN_SERVER

I create all iptables rules and VPN_CLIENT can connect to server. One client go well. But if another client try to connect he has this error
*** error 721: Remote server don't response. ***

Are you using the PPTP NAT connection tracking helper module? If not, you
will not be able to support more than one connection at a time.

Regards,

Antony.

--
There are two possible outcomes:

If the result confirms the hypothesis, then you've made a measurement. If the result is contrary to the hypothesis, then you've made a discovery.

- Enrico Fermi

Please reply to the
list;
please don't CC
me.

author
#4 lore raw
In reply to Antony Stone

I am a newbie ... Some tutorial to do this?? I have redhat 8.0, some rpm with pptp nat connection tracking??

I read in some site that i must recompile the kernel??? Or only iptables??? I am a bit confussed!

-----Mensaje original-----
De: [email protected] [mailto:[email protected]] En nombre de Antony Stone Enviado el: divendres, 14 / maig / 2004 12:40
Para: [email protected]
Asunto: Re: Iptables do nat with Protocol 47 or GRE

Quoted 5 lines · Sez

Hi people,

I have a a vpn server in my Intranet. If i want access to this server i will pass my firewall.

Quoted 8 lines

The diagram is

VPN_CLIENT(W2k box) ---- router ---- (192.168.55.94 eth0) FIREWALL (192.168.55.95 eth1)-------- (192.168.55.92)VPN_SERVER

I create all iptables rules and VPN_CLIENT can connect to server. One client go well. But if another client try to connect he has this error
*** error 721: Remote server don't response. ***

Are you using the PPTP NAT connection tracking helper module? If not, you
will not be able to support more than one connection at a time.

Regards,

Antony.

--
There are two possible outcomes:

If the result confirms the hypothesis, then you've made a measurement. If the result is contrary to the hypothesis, then you've made a discovery.

- Enrico Fermi

Please reply to the
list;
please don't CC
me.

#5 lore raw
Quoted 5 lines · Sez

I am a newbie ... Some tutorial to do this?? I have redhat 8.0, some rpm with pptp nat connection tracking??

I read in some site that i must recompile the kernel??? Or only iptables??? I am a bit confussed!

I hope someone else here will be able to help you. I do not use Red Hat,
RPMs or PPTP (I use Slackware and IPsec), so although I know what's involved, I can't give you detailed instructions for this setup.

I'm sure other people here know and will be able to advise you how to do it.

Regards,

Antony.

Signature · 6 lines
"640 kilobytes (of RAM) should be enough for anybody."

 - Bill Gates

                                                     Please reply to the list;
                                                           please don't CC me.
author
#6 lore raw

Hi, again...

I have other question about it.

If i change the ip destination on GRE packets, i don't make nat... It can work? Exist other solution that i don't recompile the kernel???

-----Mensaje original-----
De: [email protected] [mailto:[email protected]] En nombre de Antony Stone Enviado el: divendres, 14 / maig / 2004 13:30
Para: [email protected]
Asunto: Re: Iptables do nat with Protocol 47 or GRE

Quoted 4 lines · Sez

I am a newbie ... Some tutorial to do this?? I have redhat 8.0, some rpm with pptp nat connection tracking??

I read in some site that i must recompile the kernel??? Or only

iptables???

Quoted 1 line

I am a bit confussed!

I hope someone else here will be able to help you. I do not use Red Hat,
RPMs or PPTP (I use Slackware and IPsec), so although I know what's involved, I can't give you detailed instructions for this setup.

I'm sure other people here know and will be able to advise you how to do it.

Regards,

Antony.

--
"640 kilobytes (of RAM) should be enough for anybody."

- Bill Gates

Please reply to the
list;
please don't CC
me.

please don't CC me.

author
#8 lore raw
In reply to Antony Stone

And, with l2pt or ipsec, iptables work fine without path GRE???

-----Mensaje original-----
De: [email protected] [mailto:[email protected]] En nombre de Antony Stone Enviado el: divendres, 14 / maig / 2004 13:30
Para: [email protected]
Asunto: Re: Iptables do nat with Protocol 47 or GRE

Quoted 4 lines · Sez

I am a newbie ... Some tutorial to do this?? I have redhat 8.0, some rpm with pptp nat connection tracking??

I read in some site that i must recompile the kernel??? Or only

iptables???

Quoted 1 line

I am a bit confussed!

I hope someone else here will be able to help you. I do not use Red Hat,
RPMs or PPTP (I use Slackware and IPsec), so although I know what's involved, I can't give you detailed instructions for this setup.

I'm sure other people here know and will be able to advise you how to do it.

Regards,

Antony.

--
"640 kilobytes (of RAM) should be enough for anybody."

- Bill Gates

Please reply to the
list;
please don't CC
me.

please don't CC me.

#7 lore raw
In reply to Sez
Quoted 6 lines · Sez

Hi, again...

I have other question about it.

If i change the ip destination on GRE packets, i don't make nat... It can work ?

I don't understand the difference. What is NAT, if it's not changing the
source or destination IP address?

Regards,

Antony.

Signature · 10 lines
In Heaven, the police are British, the chefs are Italian, the beer is Belgian, 
the mechanics are German, the lovers are French, the entertainment is 
American, and everything is organised by the Swiss.

In Hell, the police are German, the chefs are British, the beer is American, 
the mechanics are French, the lovers are Swiss, the entertainment is Belgian, 
and everything is organised by the Italians.

                                                     Please reply to the list;
                                                           please don't CC me.
#9 lore raw
In reply to Sez
Quoted 1 line · Sez

And, with l2pt or ipsec, iptables work fine without path GRE???

IPsec does not use GRE. IPsec uses protocols 50 and 51 - ESP and AH.

IPsec works fine over NAT in Tunnel Mode (not Transport Mode without serious fiddling with things).

GRE is protocol 47.

L2TP is a UDP-based protocol (port 1701) as far as I know.

Regards,

Antony.

Signature · 7 lines
Your work is both good and original.  Unfortunately the parts that are good 
aren't original, and the parts that are original aren't good.

 - Samuel Johnson

                                                     Please reply to the list;
                                                           please don't CC me.
author
#10 lore raw

I have a microsoft server to l2tp/ipsec. And my firewall is a Linux. I understand that if i create a server in micro$oft box, i can routing the traffic with Linux with any problem (no recompile, multiple users, nat with l2tp/ipsec).

Is it true?

Thanks!

-----Mensaje original-----
De: [email protected] [mailto:[email protected]] En nombre de Antony Stone Enviado el: divendres, 14 / maig / 2004 14:45
Para: [email protected]
Asunto: Re: Iptables do nat with Protocol 47 or GRE

Quoted 1 line · Sez

And, with l2pt or ipsec, iptables work fine without path GRE???

IPsec does not use GRE. IPsec uses protocols 50 and 51 - ESP and AH.

IPsec works fine over NAT in Tunnel Mode (not Transport Mode without serious fiddling with things).

GRE is protocol 47.

L2TP is a UDP-based protocol (port 1701) as far as I know.

Regards,

Antony.

--
Your work is both good and original. Unfortunately the parts that are good aren't original, and the parts that are original aren't good.

- Samuel Johnson

Please reply to the
list;
please don't CC
me.

#11 lore raw
Quoted 4 lines · Sez

I have a microsoft server to l2tp/ipsec. And my firewall is a Linux. I understand that if i create a server in micro$oft box, i can routing the traffic with Linux with any problem (no recompile, multiple users, nat with l2tp/ipsec).

Can someone who knows about L2TP / IPsec step in here please?

Regards,

Antony.

Signature · 4 lines
The lottery is a tax for people who can't do maths.

                                                     Please reply to the list;
                                                           please don't CC me.
#12 lore raw

Im not shure about the question.

Could you be more specific?

-----Mensaje original-----
De: [email protected] [mailto:[email protected]] En nombre de Antony Stone Enviado el: Viernes, 14 de Mayo de 2004 10:15
Para: [email protected]
Asunto: Re: Iptables do nat with Protocol 47 or GRE

Quoted 4 lines · Sez

I have a microsoft server to l2tp/ipsec. And my firewall is a Linux. I understand that if i create a server in micro$oft box, i can routing the traffic with Linux with any problem (no recompile, multiple users, nat with l2tp/ipsec).

Can someone who knows about L2TP / IPsec step in here please?

Regards,

Antony.

--
The lottery is a tax for people who can't do maths.

Please reply to the
list;
please don't CC
me.

#13 lore raw
In reply to Antony Stone

Hi!

OK. I have this situation

VPN_CLIENT(w2k box) ---> router ---> FIREWALL (NAT) ---> M$ Server

I want to configure only the Firewall.

First, I tried to create a connection with pptp. Pptp need protocol GRE and iptables don't support nat with protocol GRE. I must recompile the Kernel...

M$ server also supports ipsec and l2tp. Is ipsec/l2tp supported with iptables without recompile the kernel? It's more difficult???

Thanks!

SERGI