[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
no way to compare when less than two revisions
Diferenças
Aqui você vê as diferenças entre duas revisões dessa página.
— | pt-br:howtos:network_services:tunnel_interfaces [2020/06/26 23:01 (UTC)] (atual) – criada slackjeff | ||
---|---|---|---|
Linha 1: | Linha 1: | ||
+ | ====== Tunnel Interfaces ====== | ||
+ | Se você deseja estabelecer um túnel SSH entre duas redes e tratar o túnel como uma interface, isso pode ajudar. | ||
+ | * Primeiro, eu recomendaria ativar o rc.ip_forward no /etc/rc.d/ (nas máquinas local e de destino)< | ||
+ | root@darkstar: | ||
+ | </ | ||
+ | root@darkstar: | ||
+ | </ | ||
+ | |||
+ | * Quase esqueci que você precisará ativar o tunelamento em / | ||
+ | |||
+ | <code bash> | ||
+ | root@darkstar: | ||
+ | `\ by\ `/ | ||
+ | </ | ||
+ | |||
+ | * Em seguida, estou usando o autossh encontrado em [[http:// | ||
+ | |||
+ | * Você também desejará ter conexões ssh não interativas configuradas. Significado [[howtos: | ||
+ | | ||
+ | * Supondo também que você tenha privilégios de sudo e usuário na máquina remota (usando a opção '' | ||
+ | |||
+ | < | ||
+ | rich ALL=(ALL) NOPASSWD: ALL | ||
+ | </ | ||
+ | |||
+ | * Em seguida, estou usando um script bash simples que explicarei depois de espreitar. | ||
+ | |||
+ | <file bash rc.tunnel> | ||
+ | #!/bin/bash | ||
+ | |||
+ | ########################################################### | ||
+ | # | ||
+ | #Enter the ip of the target you wish to make a tunnel with. | ||
+ | #By ip address or hostname | ||
+ | # | ||
+ | target=74.79.121.210 | ||
+ | port=22 | ||
+ | # | ||
+ | ########################################################### | ||
+ | # suggestions contact rich at lehcar.duckdns.org | ||
+ | # with thanks to Billy T (for idea and assistance) | ||
+ | ########################################################### | ||
+ | #load module | ||
+ | / | ||
+ | #load remote module | ||
+ | / | ||
+ | /bin/sleep 1 | ||
+ | |||
+ | / | ||
+ | /bin/sleep 4 | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | </ | ||
+ | |||
+ | * Para direcionar o tráfego pelo túnel, tente: | ||
+ | |||
+ | <code bash> | ||
+ | user@darkstar: | ||
+ | </ | ||
+ | |||
+ | * Para substituir o ssh normal em vez de autossh, substitua esta linha abaixo pela linha com autossh (linha 20) | ||
+ | |||
+ | <code bash> | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Para recapitular algumas das opções: "'' | ||
+ | |||
+ | ==== Resultados ==== | ||
+ | |||
+ | Agora você pode acessar o computador remoto usando "'' | ||
+ | |||
+ | Não vou conseguir elaborar as regras do iptables sou um newbie nesta questão, mas elas funcionam. | ||
+ | |||
+ | **Aqui estão alguns exemplos de uso.** | ||
+ | Direcionando o tráfego para a interface do túnel. primeiro exemplo 10.10.132.0-255 segundo 10.10.182.15 | ||
+ | |||
+ | <code bash> | ||
+ | /sbin/route add -net 10.10.132.0 netmask 255.255.255.0 dev tun0 | ||
+ | /sbin/route add -net 10.10.182.15 netmask 255.255.255.255 dev tun0 | ||
+ | </ | ||
+ | |||
+ | ====== Sources ====== | ||
+ | <!-- If you are copying information from another source, then specify that source --> | ||
+ | <!-- * Original source: [[http:// | ||
+ | <!-- Authors are allowed to give credit to themselves! --> | ||
+ | * Originally written by [[wiki: | ||
+ | <!-- * Contributions by [[wiki: | ||
+ | * --- // | ||
+ | |||
+ | <!-- Please do not modify anything below, except adding new tags.--> | ||
+ | {{tag> |