LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-26-2016, 11:21 AM   #1
anon184
LQ Newbie
 
Registered: Feb 2016
Location: Toulon, The French Riviera
Distribution: Ubuntu, Raspbian, Kali
Posts: 2

Rep: Reputation: 0
[FR+EN] Socks Proxy and Wi-Fi repeater


[EN]
Hello everybody!

I need your help today because I'm trying to use a SSH tunnel on my Raspberry Pi...

So first of all I have a RPi 2 Model B, running Raspbian (all packages up to date) and my setup is pretty simple : I use my Pi as a Wi-Fi repeater : wlan5 connected to my existing network and wlan6 is in AP mode.
I use hostapd and isc-dhcp-server in order to run the repeater.

Now I want that all the clients connected to wlan6 automatically use a SSH tunnel (without having to do something on their devices). When I open a Terminal and issue the following command, I'm able to use my tunnel in Iceweasel after setting it to use a Socks Proxy at localhost at port 1080.

Code:
ssh -N -D 1080 username@sshserver -p 22
But now, how to make my AP redirect all the traffic through that opened tunnel ? I just would like to set up a Socks Proxy for the AP, like I did with Iceweasel...
I dont' know how... Is it in the dhcpd.conf file ? Or may I deal with the iptables ?

Thank you



[FR]
Bonjour tout le monde!

J'ai besoin de votre aide aujourd'hui car j'essaye d'utiliser un tunnel SSH sur mon Raspberry Pi...

Pour commencer j'ai un RPi 2 Modèle B, qui tourne sous Raspbian (tous les packets sont à jour) et le système est plutôt simple : j'utilise le RPi comme un répéteur Wi-Fi : wlan5 est connecté à mon réseau existant et wlan6 est en mode émetteur.
J'utilise hostapd et isc-dhcp-server pour faire fonctionner le répéteur.

Maintenant je voudrais que tous les utilisateurs connectés à wlan6 utilisent automatiquement le tunnel SSH (de manière transparente quoi). Quand j'ouvre un terminal et execute la commande suivante, j'arrive à utiliser mon tunnel dans Iceweasel après l'avoir configuré pour un Proxy Socks sur localhost au port 1080.

<Voir en haut>

Mais maintenant comment faire pour que le réseau créé par le RPi redirige le trafic des utilisateurs dans ce tunnel ? Je voudrais juste faire en sorte que le Proxy Socks soit pris en compte par isc-dhcp-server ou n'importe quoi d'autre car je ne sais pas où configurer ça... Dans dhcpd.conf, dans les iptables ?

Merci



Useful config files :

/etc/hostapd/hostapd.conf
Code:
interface=wlan6
hw_mode=g
channel=11
ieee80211d=1
country_code=FR
ieee80211n=1
wmm_enabled=1
ssid=MyRpiAP
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=helloworld
/etc/dhcp/dhcpd.conf
Code:
ddns-update-style none;

authoritative;

log-facility local7;

subnet 192.168.42.0 netmask 255.255.255.0 {
  range 192.168.42.10 192.168.42.250;
  option domain-name-servers 8.8.8.8, 8.8.4.4;
  option domain-name "cilusse";
  option routers 192.168.42.1;
  option broadcast-address 192.168.42.255;
  default-lease-time 600;
  max-lease-time 7200;
}
And I tried to add those lines, without any results :
Code:
option local-pac-server code 252 = text;
option local-pac-server "/home/pi/Documents/Work/proxy.pac";
/etc/iptables.ipv4.nat
Code:
# Generated by iptables-save v1.4.21 on Mon Jan  4 20:23:54 2016
*filter
:INPUT ACCEPT [14:1059]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [16:1604]
-A FORWARD -i wlan5 -o wlan6 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan6 -o wlan5 -j ACCEPT
COMMIT
# Completed on Mon Jan  4 20:23:54 2016
# Generated by iptables-save v1.4.21 on Mon Jan  4 20:23:54 2016
*nat
:PREROUTING ACCEPT [7:224]
:INPUT ACCEPT [1:32]
:OUTPUT ACCEPT [22:1674]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o wlan5 -j MASQUERADE
COMMIT
# Completed on Mon Jan  4 20:23:54 2016
Tell me if you need more config files ^^
 
Old 03-04-2016, 09:16 AM   #2
anon184
LQ Newbie
 
Registered: Feb 2016
Location: Toulon, The French Riviera
Distribution: Ubuntu, Raspbian, Kali
Posts: 2

Original Poster
Rep: Reputation: 0
Solved using this script : http://superuser.com/questions/66736...y-in-other-sub
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RDP over SOCKS proxy drManhattan Linux - Networking 3 04-23-2015 09:55 AM
rdesktop behind SOCKS proxy kkpal Linux - Networking 0 01-12-2011 07:15 AM
proxy server that accepts PARENT PROXY as a SOCKS PROXY shadyabhi Linux - Server 1 08-10-2010 03:09 PM
[ask] using wget through SOCKS proxy arroquant Linux - Software 5 09-30-2009 06:12 PM
Can I use ntpd through a socks proxy?? zhaoyoubing Linux - Networking 0 07-23-2003 09:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration