Mise en place d'un tunnel SSH vers une fonera
Par Lama Bleu le jeudi 5 juillet 2007, 20:12 - Fonera - Lien permanent
Voici une méthode presque simple pour ouvrir un accès en tunnel SSH vers sa
fonera distante.
L'énorme avantage que je lui trouve est de pouvoir accéder à distance aux IP de
son réseau local que l'on désignera ( notamment en HTTP) en n'ayant rien
d'autre à ouvrir sur son routeur et la fonera que le port 22 SSH.
On évite ainsi toute manipulation parfois hasardeuse de son fichier
/etc/firewall.user.
bien lire les avertissements de ce billet ...
Pour être plus court dans mes phrases ( sic ), ce que j'appelle le "PC
client" est le PC sur lequel tu es ( au bureau si ton SI laisse sortir le port
22 , en vacances sur ton PC portable, etc ...) et qui te sert à te connecter à
ta fonera via internet.
L'avantage n°1 c'est qu'il n'y a rien à installer sur la Fonera, et un
simple client SSH type PuTTY sur le PC où tu te trouves !
L'inconvénient n°1 est la sécurité : il faut absolument pour l'accès SSH
sur la fonera prévoir un mot de passe "costaud", ne le donner à personne, le
renouveler régulièrement, ou mieux utiliser des certificats.
Un fonero averti en vaut ... au moins dix !
Fonctionnalités testées et avertissement:
- accès à la page de config HTTP de la fonera en passant par le
tunnel, donc sans avoir à ouvrir le port 80 sur la fonera ( et pas de
redirection nécessaire pour routeur/modem/box à part le port 22 évidemment
..).
- possibilté d'accès également à la config HTTP ou telnet du
modem/routeur/box
- un serveur FTP du réseau local devient aussi accessible
- - il est également possible d'aller plus loin encore avec les transferts de
flux vidéo, ou newsgroups par exemple depuis une fonera mais cette manip vous
mettrait en irrégularité avec votre FAI sur vos conditions de ventes (les CGV),
voire hors-la-loi, d'où l'importance de n'utiliser cette méthode que pour
accéder au réseau local de la fonera. ( merci à mon compère de m'avoir permis
de regarder télématin sur mon PC alors que je n'ai pas la TV
ADSL...).
Donc dans ce cas il ne peut s'agir que d'un test de quelques minutes
et rien de plus sous peine de s'attirer des ennuis, au mieux le FAI, le
propriétaire de la fonera si ce n'est pas toi, au pire la justice
...
Et une fonera trop sollicitée chauffe, la bande passante de FAI n'est pas
infinie, voici de bonnes raisons pour rester raisonnable.
Attention, ouvrir un tunnel SSH ne revient pas à fabriquer un proxy ou un
ouvrir un tunnel VPN, c'est trompeur mais nous restons ici un niveau au
dessous.
Il ne s'agit ici que de récupérer (remapper ?) sur un port local de sa machine
un accès vers une IP et un port prédéfinis sur le(s) réseau(x) accessible(s) à
la fonera .
Concrètement :
http://localhost:8181 (sur mon lieu de vacances ...) peut
pointer au travers du tunnel SSH sur http://192.168.10.1 port
80 à mon domicile habituel. (dans le cas la console HTTP de la
Fonera)
Bon, c'est parti ...
Pré-requis
- une fonera avec son accès SSH ouvert sur le port ethernet RJ45 ( la
méthode est décrite partout sur les FON-sites du web ..)
- le modem, routeur, ou la "box" doit être configuré pour accepter/rediriger
les connexions entrantes internet sur le port 22 de la-dite fonera ..
- la machine distante qui servira à se connecter par internet à la fonera
distante n'aura besoin que du logiciel ( gratuit ) PuTTY
En résumé, il faut être capable de se connecter à distance en SSH à sa fonera,
et rien de plus, ce que sait faire tout fonero bricoleur fréquentant les
forums. 
Du côté de la fonera :
Il n'y à aucun script à déployer, aucun package à installer. Il faut remplir
les conditions du pré-requis, et s'assurer que la fonera accède à toutes les
machines et/ou éléments réseau sur lesquels il faudra accéder depuis
l'extérieur.
Pour le PC tout se joue dans la config de la session SSH
sous PuTTY:
sur une session existante et fonctionnelle vers ta fonera tu vas pouvoir
indiquer quels ports locaux de ton PC clients vont permettre d'accéder aux IP
et ports désignés sur ta fonera.
Exemple concret (de ma config) :
la fonera est en IP : 169.254.255.1 et le modem ( simple modem pour du
PPPoE, non routeur donc pas de DHCP) est sur 169.254.254.1 avec le masque de
sous-réseau qui va bien...
-je prends le port 8282 de mon PC client pour le rediriger vers le port 80 de
169.254.255.1 ( la page de config HTTP de la fonera)
-je prends le port 8181 de mon PC client pour le rediriger vers le port 8080 de
169.254.254.1 ( la page de config HTTP du modem par exemple)
Copie d'écran :

Pour modifier les ports dans la session PuTTY, aller dans
Connection/SSH/Tunnel, préciser pour "Source port" le port local à
utiliser sur le PC client, et pour "Destination" l'adresse IP et le port qui
doivent être contacté sur le lan distant ( format IP:port
)
Bon ben voilà, c'est fait !
Il ne reste plus qu'à se connecter à la fonera en SSH de manière classique
(pour ouvrir le tunnel), puis lancer ton navigateur favori et aller sur
http://localhost:8181 pour accéder à la page de config HTTP de ton modem, et
http://localhost:8282 pour accéder à ta Fonera en HTTP ...
Dernières remarques :
Il y a sûrement des limites et restrictions à l'utilisation de cette méthode.
Aucune résolution DNS ne se fait par le biais du tunnel tu es donc limité à
l'adresse IP indiquée dans la redirection.
Si une page présente un lien vers une autre adresse IP, tu ne pourras sûrement
pas y accéder.
Dans mon cas précis, ma fonera n'est ni derrière un routeur, ni derrière une
box, mais le principe est exactement le même ( avec un routeur ou une box il
faudrait ouvrir le port 22 vers la fonera).
L'excellent Jojop a fait la manip au travers de sa box sans aucun problème. Ne
pas se laisser perturber par le fait que les IP soient en 169.254.xx.yy pour
cet exemple !
Cette méthode devrait fonctionner aussi pour les linksys sous OpenWRT.
Source intéressante qui m'a servi à mettre en place la connexion : ici
Il reste beaucoup à faire, à chacun d'adapter selon ses besoins.
Un grand merci à Jojop, fonero de son état, cobaye et utilisateur occasionnel de FON_BASTIDE




Commentaires
Salut, alors voila je vient de suivre ton tuto mais juste pour précision , l'adress ip que tu utilise c'est bien celle lorsque l'ont ce connecte en ethernet qui faut utilisé ? merci d'avance , car pour moi ca ne marche pas
alors voila je vient de suivre ton tuto mais juste pour précision , l'adress ip que tu utilise c'est bien celle lorsque l'ont ce connecte en ethernet qui faut utilisé ?
I found your website perfect for my needs. It contains wonderful and helpful posts. I have read most of them and got a lot from them.
the paper is interesting here.
<a href="http://www.kidsairjordanshoes.com/">big kids jordans</a>
<a href="http://www.kidsairjordanshoes.com/">kids jordans cheap</a>
<a href="http://www.kidsairjordanshoes.com/">kids jordan shoes</a>
<a href="http://www.kidsairjordanshoes.com/">kids air jordan shoes</a>
<a href="http://www.kidsairjordanshoes.com/">kids air jordans</a>
<a href="http://www.airjordanfusionshoes.com...">jordan fusions</a>
<a href="http://www.airjordanfusionshoes.com...">cheap jordan fusions</a>
<a href="http://www.airjordanfusionshoes.com...">air jordan fusions</a>
<a href="http://www.airjordanfusionshoes.com...">air jordan fusion</a>
<a href="http://www.airjordanfusionshoes.com...">air jordan fusion shoes</a>
the paper is interesting here.
<a href="http://www.kidsairjordanshoes.com/">big kids jordans</a>
<a href="http://www.kidsairjordanshoes.com/">kids jordans cheap</a>
<a href="http://www.kidsairjordanshoes.com/">kids jordan shoes</a>
<a href="http://www.kidsairjordanshoes.com/">kids air jordan shoes</a>
<a href="http://www.kidsairjordanshoes.com/">kids air jordans</a>
<a href="http://www.airjordanfusionshoes.com...">jordan fusions</a>
<a href="http://www.airjordanfusionshoes.com...">cheap jordan fusions</a>
<a href="http://www.airjordanfusionshoes.com...">air jordan fusions</a>
<a href="http://www.airjordanfusionshoes.com...">air jordan fusion</a>
<a href="http://www.airjordanfusionshoes.com...">air jordan fusion shoes</a>
Very interesting topic will bookmark your site to check if you write more about in the future.
Valuable information and excellent design you got here! I would like to thank you for sharing your thoughts and time into the stuff you post!! Thumbs up
Fine information, many thanks to the author. It is puzzling to me now, but in general, the usefulness and significance is overwhelming. Very much thanks again and good luck!
Its really wonderful and watchable. I like to share it with all my friends and hope they will definitely like it.
You have a very good site, well constructed and very interesting i have bookmarked you hopefully you keep posting new stuff, many thanks.
retail pharmacy hub
cialis advisor directory
birth control pills dosage
lowcost cialis
cheap viagra reviews
sleep better birth control pills
Really appreciate this post. It’s hard to sort the good from the bad sometimes, but I think you’ve nailed it!
This is a really good post. Must admit that you are amongst the best bloggers I have read. Thanks for posting this informative article.
Useful information ..I am very happy to read this article..thanks for giving us this useful information. Fantastic walk-through. I appreciate this post.
Useful information ..I am very happy to read this article..thanks for giving us this useful information. Fantastic walk-through. I appreciate this post.
Really appreciate this post. It’s hard to sort the good from the bad sometimes, but I think you’ve nailed it!
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your posts. Any way I'll be subscribing to your feed and I hope you post again soon..
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.
I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post
I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well.
Good post....thanks for sharing.. very useful for me i will bookmark this for my future needed. thanks for a great source.
I have been looking for this,I loved to read your article.You must be putting a lot of time into your blog!
This is a really good post. Must admit that you are amongst the best bloggers I have read. Thanks for posting this informative article.
I read your post . it was amazing.Your thought process is wonderful.The way you tell about things is awesome.
Hey, your blog is a great one. I will bookmark it.
Always so interesting to visit your site.What a great info, thank you for sharing. this will help me so much in my learning.
You have got some great posts in your blog. I will be visiting again.
Thanks for this. I really like what you've posted here and wish you the best of luck with this blog!
I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.
Easy option to get useful information as well as share good stuff with good ideas and concepts.
Thanks for sharing these useful information! Hope that you will continue doing nice article like this.
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.
I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I will be subscribing to your feed and I hope you post again soon.
Came across your blog and I must say, it really impressed me. The amount of topics you guys have managed to cover has left little scope for the imagination. Do you guys invite people make guest posts too?
This is a good,common sense article.Very helpful to one who is just finding the resouces about this part.It will certainly help educate me.
I must tell you that your post is totally cool I fantastically like your theme! Right now I have a lot of spare time to read your website because of which I added it to my bookmarks.
Mise en place d'un tunnel SSH - cette info est utile pour mes recherches!
sur une session existante et fonctionnelle vers ta fonera tu vas pouvoir indiquer quels ports locaux de ton PC clients vont permettre d'accéder aux IP et ports désignés sur ta fonera
Thanks much for this method brilliant publish; this is the kind of component that sustains me though out the day.
People in every country take the personal loans from different banks, because that's comfortable and fast.
I do not know a proper way to express my emotions after the utilizing the help of <a href="http://www.bestwritingservice.com">essay writing service</a>. I would state that my outline essays are perfect at present time. Essay online writers seem to be really nice.
Very captivating circumstance about this post, but still this argument is to hard to discuss.That is why we have mastered to create a custom writing service to help striving students. They can <a href="http://www.essaysprofessors.com">buy term paper</a> that is custom and made by expert , <a href="http://www.essaysprofessors.com">buy essay</a> or even <a href="http://www.essaysprofessors.com">buy research paper</a>. But when people use this kind of business – an ethical question is raised: Is it ok to use these kinds of services? Is it ok to use them, and will you be punished for using them.
Nice blog here! Also your website loads up fast! What web host are you using? Can I get your affiliate link to your host
Of course you are able to spend your cash for sweets or some books, nevertheless, it will not aid you to build your career. You should pay your money in a smart way, for example for <a href="http://www.supremeessays.com/case-s...">case study writing</a> company.
Great suggestion I recently stumble your blog and have been reading along
i just added your blog site to my blogroll, i pray you would give some thought to doing the same.
thanks much for this method brilliant publish; this is the kind of component that sustains me though out the day
you truly most| certainly appreciate how you can carry a dilemma in order to easy to make the thought vital
if i link to that page website would it be okay to accomplish that
know precisely what they’re discussion almost about on the world wide web.
i guess you inverted the most beneficial using the worst.
If you try to find locality where you can get <a href="http://www.prime-resume.com">resume writer</a> here is very dynamite place for you about this post, which care examples and gives an occasion to learn how make great CV resumes . But this site is more delightful, and more contributive.
Excellent post. Keep sharing.
all bought and downloaded very quickly at a good speed. fully functional and 100% functional software. here's the link
i touch enjoy i’m constantly looking since appealing things on study regarding a type of topics
Reall wonderful post. I liked understanding it plus will tally it toward my bookmarks.
Genuinely definitely very good website article which has got me considering. I never looked at this from your point of view.
I found this is an informative and interesting post so i think so it is very useful and knowledgeable.
Valuable information and excellent design you got here! I would like to thank you for sharing your thoughts and time into the stuff you post!! Thumbs up
i am always thought about this, regards for posting .
this blog is awesome full of usefull information that i was in dire need of.
I actually like what you have acquired here, certainly like what you are saying and the way in which you say it.
it is my opinion you may be right, if we create for other online sites, several of that is extracted from our fingers
Speaking of users, the Zune Social is also great fun, letting you find others with shared tastes and becoming friends with them.
i love your website. i'm gonna post a link on my twitter page!
Nice to see some decent content amongst the dross that is now the internet.
Awesome Post. I add this Post to my bookmarks.
This is a good,common sense article.Very helpful to one who is just finding the resouces about this part.It will certainly help educate me.
I really liked the post and the stories are really thanks for sharing the informative post.
Will be back later to read some more.
Wonderful post! I enjoy reading it!
this show up she seldom wear street style collocation, but whatever she wore connects body leather shorts or jacket collocation tall waist shorts, integral modelling are preserved her
Really impressed! Everything is very open and very clear explanation of issues. It contains truly information. Your website is very useful. Thanks for sharing. Looking forward to more!
I want to say your blog is very great. I usually like to read some thing new about this because I’ve the comparable blog in my Country on this subject so this help’s me a lot. I did a search on the topic and found a good number of blogs but nothing like this.Thanks for writing so much inside your blog.
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your post
Essay paper writers are ready to assist in writing college papers of any difficulty.
wonderful place to socialize, you have a lot of well written and fun to read articles no wonder you have a good following in your website. I will definitely bookmark this a
Not too many people would actually think about this the way you just did.
I will bookmark your weblog and check again here frequently. I'm quite sure I'll learn many new stuff right here! Best of luck for the next.
Thank you to share with me for something
I am very thank you to share this article,it’s very good,I hope you can share more,and I will continue to read,thanks!
Great information about git, I’ve read so many blogs about politics and it’s good to have a change for while with blogs and learn something new.
Go for someone who makes you smile because it takes only a smile to make a dark day seem bright.
Life is beautiful, every thing each person can affect our lives, which we at this moment to calm yourself down, slowly appreciate this piece of good article. How do I know it to life. How to start a new plan.
Hey ! am I glad to vist your blog ! from this I can get some information and facts that I didn’t know prior to. You made my day. Thank you rather much!