Author Topic: vpn routage iptables squid  (Read 1031 times)

emiliefr1984

  • Guest
vpn routage iptables squid
« on: December 01, 2010, 10:36:39 AM »
bonssir a tous, ca va?
j'ai un gros souci, je m'explique:
voici mon reseaux qui est un serveur squid proxy transparent avec iptables dessus
problematique? comment faire passer mon vpn a travers mon interface b  et a, vice versa..


                                 |   
                                 |  A   192.168.1.1

                   |                         |
88.8.8.8      B    |  proxysquid/iptables
                                              |     C      192.168.10.3
         sdsl      |                         |      adsl
                   |                         |
                   |                         |
                 Moden                        Modem

je veut faire passer mon vpn pptp gre atravers ma ligne sdsl puis passant par l'interface a et b et vice versa
j'ai configurer ceci dans iptables pour transiter les paquets de mon interface b à a et j'aimerai savoir si c'est correct et comment transiter a travers a puis b


### Redirection du port 1723/tcp vers serveur PPTP
$IPT -A FORWARD -i eth2 -o eth0 -d $IP_PPTP -p tcp --sport 1024:65535 \
 --dport 1723 -m state --state NEW,ESTABLISHED -j ACCEPT
$IPT -A FORWARD -i eth0 -o eth2 -s $IP_PPTP -p tcp --sport 1723 \
 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

### Redirection du protocole GRE vers serveur PPTP
$IPT -A FORWARD -i eth2 -o eth0 -d $IP_PPTP -p gre \
 -m state --state NEW,ESTABLISHED -j ACCEPT
$IPT -A FORWARD -i eth0 -o eth2 -s $IP_PPTP -p gre \
 -m state --state ESTABLISHED -j ACCEP


su quelqu'un peut m'aider? voire meme sur msn, merci..

Offline yodelu

  • PCLinuxOS Tester
  • Sr. Member
  • *******
  • Posts: 317
Re: vpn routage iptables squid
« Reply #1 on: December 03, 2010, 11:15:50 AM »
if your (transparent) squid proxy is working fine don't need to configure firewall to forward vpn packets between eth0 and eth2 . just add the ports used by your vpn application in squid.conf as safe_ports
it works for me and i hope it will works for you...

Online muungwana

  • Hero Member
  • *****
  • Posts: 6235
Re: vpn routage iptables squid
« Reply #2 on: December 03, 2010, 04:45:54 PM »

can somebody translate this to english? i skipped french in high school and and ..and .. lets just leave it at that   :D

packet forwarding will work only when the kernel is configured to allow it and you can do that by running this command:

echo 1 > /proc/sys/net/ipv4/ip_forward

The option is set at runtime and hence will not survive a reboot but it can be set permanently if the user wishes to.

Can somebody translate this back to french
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: vpn routage iptables squid
« Reply #3 on: December 03, 2010, 05:15:35 PM »

can somebody translate this to english? i skipped french in high school and and ..and .. lets just leave it at that   :D

packet forwarding will work only when the kernel is configured to allow it and you can do that by running this command:

echo 1 > /proc/sys/net/ipv4/ip_forward

The option is set at runtime and hence will not survive a reboot but it can be set permanently if the user wishes to.

The first post:
voici mon reseau qui est un serveur squid proxy transparent avec iptables dessus
problematique? comment faire passer mon vpn a travers mon interface b  et a, vice versa..


                                 |   
                                 |  A   192.168.1.1

                   |                         |
88.8.8.8      B    |  proxysquid/iptables
                                              |     C      192.168.10.3
         sdsl      |                         |      adsl
                   |                         |
                   |                         |
                 Moden                        Modem

je veut faire passer mon vpn pptp gre atravers ma ligne sdsl puis passant par l'interface a et b et vice versa
j'ai configurer ceci dans iptables pour transiter les paquets de mon interface b à a et j'aimerai savoir si c'est correct et comment transiter a travers a puis b


### Redirection du port 1723/tcp vers serveur PPTP
$IPT -A FORWARD -i eth2 -o eth0 -d $IP_PPTP -p tcp --sport 1024:65535 \
 --dport 1723 -m state --state NEW,ESTABLISHED -j ACCEPT
$IPT -A FORWARD -i eth0 -o eth2 -s $IP_PPTP -p tcp --sport 1723 \
 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT

### Redirection du protocole GRE vers serveur PPTP
$IPT -A FORWARD -i eth2 -o eth0 -d $IP_PPTP -p gre \
 -m state --state NEW,ESTABLISHED -j ACCEPT
$IPT -A FORWARD -i eth0 -o eth2 -s $IP_PPTP -p gre \
 -m state --state ESTABLISHED -j ACCEP

Here is my network which is a transparent squid proxy server with iptables on it. Problem ? Let my vpn go through be interface b and a, and reverse...


                                 |   
                                 |  A   192.168.1.1

                   |                         |
88.8.8.8      B    |  proxysquid/iptables
                                              |     C      192.168.10.3
         sdsl      |                         |      adsl
                   |                         |
                   |                         |
                 Moden                        Modem

I want to get my vpn pptp gre to go through my sdsl connection, then go through interfaces a and b and reverse.
I configured this in iptables to move the packets from my interface b to a and I would like to know if that is correct and how to move through a then through b   
                 
### Redirection  of the port 1723/tcp to the PPTP server
$IPT -A FORWARD -i eth2 -o eth0 -d $IP_PPTP -p tcp --sport 1024:65535 \
 --dport 1723 -m state --state NEW,ESTABLISHED -j ACCEPT
$IPT -A FORWARD -i eth0 -o eth2 -s $IP_PPTP -p tcp --sport 1723 \
 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT         
 
 ### Redirection of the GRE protocol to the PPTP server
$IPT -A FORWARD -i eth2 -o eth0 -d $IP_PPTP -p gre \
 -m state --state NEW,ESTABLISHED -j ACCEPT
$IPT -A FORWARD -i eth0 -o eth2 -s $IP_PPTP -p gre \
 -m state --state ESTABLISHED -j ACCEP 


Is that ok ? I can translate very long texts too if you want me to, provided you offer a good salary.  ;D

miliefr1984 : je te souhaite la bienvenue sur ce forum.
S'il te plaît ne nous parle pas de cet anti-chambre des ténèbres sulfureuses qu'est msn. Nous utilisons IRC : serveur irc.freenode.net, en français : #pclinuxos-fr, #pclinuxos-support pour l'aide.

Autre chose, c'est très technique ton truc, alors essaies de rédiger très correctement en français, syntaxe, accents, et tout, (prévisualises, relis-toi...) parce que après pour les gens qui veulent t'aider c'est plus facile.

Réponse de mungwana:
Quote
Le forwarding de paquets ne fonctionnera qu'une fois le kernel configuré pour l'autoriser, et tu peux faire ça en utilisant cette commande:

Code: [Select]
echo 1 > /proc/sys/net/ipv4/ip_forward
Cette option est configurée pour la session et ne survivra pas au reboot, mais elle peut être configurée de manière permanente s'il l'utilisateur le souhaite.

Can somebody translate this back to french

Done. ;)

Merci, bonne fin de nuit. :)

melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Online muungwana

  • Hero Member
  • *****
  • Posts: 6235
Re: vpn routage iptables squid
« Reply #4 on: December 03, 2010, 05:34:36 PM »

thats more than ok, thanks

final translation  :D ..this is a FYI for the original poster.

When the kernel is configured to allow packet forwarding(as explained above), it forwards all packets by default and hence the "FORWARD" chain is there to selectively choose what traffic to block.

His above iptables rules seem to suggest he things forwarding is blocked by default and rules are needed to allow them and this is not correct.

Once the kernel is configured to allow package forwarding, packet will start to be forwarded without any iptables rules to allow them

ahsante sana kwa uungwana wako :D
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..