|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: May 2003
Messaggi: 1534
|
Modifica tabella routing IP
Ciao a tutti, su windows ho un bat che modifica l'interfaccia di rete da utilizzare per ogni ip.
In pratica riesco (con il comando route) ha dire per l'ip A usa uil gateway 1 mentre per l'ip B usa il gateway 2. Questo mi consente di tenere connessi sia la wifi che la lan per accedere a reti con impostazioni diverse. Come posso replicare la stessa cosa su Ubuntu 10.10?
__________________
Intel e5450 |-| Dark Knight Xigmatek S1283 |-| Asus P5k SE/EPU |-| OCZ DDR2 PC2-6400 Platinum Revision 2 Dual Channel 4X1024MB 893Mhz |-| Seagate Barracuda 7200.11 500 Gb Sata 300 Buffer 32 Mb 7200 Rpm |-| Sapphire HD 6950 2GB DDR5 |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
dovrebbe essere simile
il comando e' route: http://www.firenze.linux.it/~piccard...in/node14.html http://manpages.ubuntu.com/manpages/...8/route.8.html p.s. oppure: iproute2 http://www.rigacci.org/wiki/doku.php...source_routing |
![]() |
![]() |
![]() |
#3 |
Senior Member
Iscritto dal: May 2003
Messaggi: 1534
|
Ciao,
scusa ma sono proprio niubbo per quanto riguarda il networking allora se faccio route -n mi appare Destination Gateway Genmask Flags Metric Ref Use Iface aa.bb.cc.dd 0.0.0.0 255.255.252.0 U 1 0 0 eth0 ee.ff.gg.hh 0.0.0.0 255.255.248.0 U 2 0 0 eth1 0.0.0.0 aa.bb.cc.ii 0.0.0.0 UG 0 0 0 eth0 Dove eth0 è la lan e eth1 è il wireless. Allora ho aggiunto con il comando route add default gw aa.bb.cc.ii il proxy aziendale relativo alla lan (eth0) visto che voglio che sia la scelta di default. Ora voglio aggiungere la regola che invece mi ridirige il traffico verso il server smtp di fastweb 85.18.95.134 (imap.fastwebnet.it) sulla eth1.. Ho provato route add -net 85.18.95.134 netmask ee.ff.gg.hh dev eth1 ma non funziona, mi dice route: bogus netmask ee.ff.gg.hh
__________________
Intel e5450 |-| Dark Knight Xigmatek S1283 |-| Asus P5k SE/EPU |-| OCZ DDR2 PC2-6400 Platinum Revision 2 Dual Channel 4X1024MB 893Mhz |-| Seagate Barracuda 7200.11 500 Gb Sata 300 Buffer 32 Mb 7200 Rpm |-| Sapphire HD 6950 2GB DDR5 |
![]() |
![]() |
![]() |
#4 |
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
neanche io sono esperto
proverei: route add -net 85.18.95.0 netmask 255.255.255.0 dev eth1 oppure che ne dici di: route add 85.18.95.134 eth1 |
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: May 2003
Messaggi: 1534
|
Ho provato entrambe le righe, mi aggiunge la riga nella tabella visualizzata da route -n ma quando riattacco la lan e wifi insieme, se faccio ping 85.18.95.134 non riesce a eseguirlo (perchè sta usando la lan che non consente l'accesso a imap esterni)
Destination Gateway Genmask Flags MSS Window irtt Iface 74.125.39.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 209.85.227.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 85.18.95.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 62.101.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 proxy 0.0.0.0 255.255.252.0 U 0 0 0 eth0 wifiGate 0.0.0.0 255.255.248.0 U 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1 0.0.0.0 proxy 0.0.0.0 UG 0 0 0 eth0 Stando alla tebella devo indicare che il gateway per eth1 deve esser wifiGate un po come in automatico si è settato il proxy aziendale per le destinazioni 0.0.0.0
__________________
Intel e5450 |-| Dark Knight Xigmatek S1283 |-| Asus P5k SE/EPU |-| OCZ DDR2 PC2-6400 Platinum Revision 2 Dual Channel 4X1024MB 893Mhz |-| Seagate Barracuda 7200.11 500 Gb Sata 300 Buffer 32 Mb 7200 Rpm |-| Sapphire HD 6950 2GB DDR5 Ultima modifica di mcgyver83 : 11-01-2011 alle 08:30. |
![]() |
![]() |
![]() |
#6 |
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
mmm
e con: ping -I eth1 85.18.95.134 |
![]() |
![]() |
![]() |
#7 |
Senior Member
Iscritto dal: May 2003
Messaggi: 1534
|
PING 85.18.95.134 (85.18.95.134) from wifi eth1: 56(84) bytes of data.
niente da fare :-(
__________________
Intel e5450 |-| Dark Knight Xigmatek S1283 |-| Asus P5k SE/EPU |-| OCZ DDR2 PC2-6400 Platinum Revision 2 Dual Channel 4X1024MB 893Mhz |-| Seagate Barracuda 7200.11 500 Gb Sata 300 Buffer 32 Mb 7200 Rpm |-| Sapphire HD 6950 2GB DDR5 |
![]() |
![]() |
![]() |
#8 |
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
mmm
- vedo molte rotte statiche su eth1 - eth1 e' su? p.s. forse e' meglio se aspettiamo qualche esperto |
![]() |
![]() |
![]() |
#9 |
Senior Member
Iscritto dal: May 2003
Messaggi: 1534
|
Si si eth1 è attiva.
Ho aggiunto altre destinazioni oltre a quella che ti ho scritto (i vari imap di fastbweb,tin,libero,google e i rispettivi smtp).
__________________
Intel e5450 |-| Dark Knight Xigmatek S1283 |-| Asus P5k SE/EPU |-| OCZ DDR2 PC2-6400 Platinum Revision 2 Dual Channel 4X1024MB 893Mhz |-| Seagate Barracuda 7200.11 500 Gb Sata 300 Buffer 32 Mb 7200 Rpm |-| Sapphire HD 6950 2GB DDR5 |
![]() |
![]() |
![]() |
#10 |
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
hai gia provato a mettere il default sulla eth1 ?
|
![]() |
![]() |
![]() |
#11 |
Senior Member
Iscritto dal: May 2003
Messaggi: 1534
|
Mmm no...domani mattina provo ma diciamo che non voglio la eth01 come default perchè vorrei usare la lan per default ma domani provo.
__________________
Intel e5450 |-| Dark Knight Xigmatek S1283 |-| Asus P5k SE/EPU |-| OCZ DDR2 PC2-6400 Platinum Revision 2 Dual Channel 4X1024MB 893Mhz |-| Seagate Barracuda 7200.11 500 Gb Sata 300 Buffer 32 Mb 7200 Rpm |-| Sapphire HD 6950 2GB DDR5 |
![]() |
![]() |
![]() |
#12 |
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
non mi ricordo se va attivato l'IPforwarding
p.s. su windows hai le stesse rotte? |
![]() |
![]() |
![]() |
#13 |
Senior Member
Iscritto dal: May 2003
Messaggi: 1534
|
Si si, il file che mi sta funzionando su win è:
@echo off rem set Wireless as default gateway route change 0.0.0.0 mask 0.0.0.0 wifi metric 20 route add 85.205.0.0 mask 255.255.240.0 proxy metric 20 route add 85.205.16.0 mask 255.255.254.0 proxy metric 20 route add 85.205.18.0 mask 255.255.255.0 proxy metric 20 route add 85.205.246.0 mask 255.255.254.0 proxy metric 20 route add 145.230.0.0 mask 255.255.000.0 proxy metric 20 route add 195.232.128.0 mask 255.255.128.0 proxy metric 20 rem route add 195.232.9.60 mask 255.255.128.0 proxy metric 20 rem route add 85.205.221.243 mask 255.255.128.0 proxy metric 20 route add 195.233.0.0 mask 255.255.000.0 proxy metric 20 route add 85.205.228.0 mask 255.255.255.0 proxy metric 20 route print pause
__________________
Intel e5450 |-| Dark Knight Xigmatek S1283 |-| Asus P5k SE/EPU |-| OCZ DDR2 PC2-6400 Platinum Revision 2 Dual Channel 4X1024MB 893Mhz |-| Seagate Barracuda 7200.11 500 Gb Sata 300 Buffer 32 Mb 7200 Rpm |-| Sapphire HD 6950 2GB DDR5 |
![]() |
![]() |
![]() |
#14 |
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
bo
p.s. con "traceroute" vedi la via dei pacchetti? |
![]() |
![]() |
![]() |
#15 |
Senior Member
Iscritto dal: May 2003
Messaggi: 1534
|
Allora ho eseguito:
sudo route add 85.18.95.134 eth1 (l'ip è di pop.fastwebnet.it) facendo route vedo: Destination Gateway Genmask Flags Metric Ref Use Iface pop.fastwebnet.it * 255.255.255.255 UH 0 0 0 eth1 145.230.32.0 * 255.255.252.0 U 1 0 0 eth0 wifi * 255.255.248.0 U 2 0 0 eth1 link-local * 255.255.0.0 U 1000 0 0 eth1 default d-bb-05-csw-ha- 0.0.0.0 UG 0 0 0 eth0 dalla tebella sembra ok,faccio traceroute: traceroute pop.fastwebnet.it traceroute to pop.fastwebnet.it (85.18.95.134), 30 hops max, 60 byte packets 1 62.213.144.8 (62.213.144.8) 66.671 ms 70.282 ms 80.825 ms 2 * * * 3 * * * 4 * * * 5 * * * 6 *^C Quindi sembra tutto ok ma: PING pop.fastwebnet.it (85.18.95.134) 56(84) bytes of data. ^C --- pop.fastwebnet.it ping statistics --- 37 packets transmitted, 0 received, 100% packet loss, time 36287ms Ora però ho un dubbio: connesso con il solo wifi riesco a scaricare la posta da fastweb ma continuo a non riuscire a pingare l'host di pop.fastwebnet.it :-(
__________________
Intel e5450 |-| Dark Knight Xigmatek S1283 |-| Asus P5k SE/EPU |-| OCZ DDR2 PC2-6400 Platinum Revision 2 Dual Channel 4X1024MB 893Mhz |-| Seagate Barracuda 7200.11 500 Gb Sata 300 Buffer 32 Mb 7200 Rpm |-| Sapphire HD 6950 2GB DDR5 Ultima modifica di mcgyver83 : 20-01-2011 alle 09:48. |
![]() |
![]() |
![]() |
#16 |
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
non capisco perche' non vada:
ping -I eth1 85.18.95.134 |
![]() |
![]() |
![]() |
#17 |
Senior Member
Iscritto dal: May 2003
Messaggi: 1534
|
Attualmente la mia tabella è:
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface imap azienda 0.0.0.0 255.255.255.255 UH 30 0 0 eth1 smtp.fastwebnet.it 0.0.0.0 255.255.255.255 UH 30 0 0 eth1 imap.fastwebnet.it 0.0.0.0 255.255.255.255 UH 30 0 0 eth1 smtp azienda 0.0.0.0 255.255.255.255 UH 30 0 0 eth1 145.230.32.0 0.0.0.0 255.255.252.0 U 1 0 0 eth0 62.213.144.0 0.0.0.0 255.255.248.0 U 2 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth1 0.0.0.0 145.230.32.7 0.0.0.0 UG 0 0 0 eth0 ping -I eth1 smtp azienda 100% packet loss, time 72492ms ping -I eth1 imap azienda 100% packet loss, time 55430ms ping -I eth1 imap.FASTWEBNET.IT 3 packets transmitted, 3 received, ping -I eth1 smtp.FASTWEBNET.IT 100% packet loss, time 17128ms Effettivamente da thunderbird riesco a ricevere mail di fastweb ma non riesco a mandarne nè da fastweb nè dall'smtp dell'azienda. Uffa, eppure nella route -n questi 4 indirizzi hanno la stessa configurazione .-(
__________________
Intel e5450 |-| Dark Knight Xigmatek S1283 |-| Asus P5k SE/EPU |-| OCZ DDR2 PC2-6400 Platinum Revision 2 Dual Channel 4X1024MB 893Mhz |-| Seagate Barracuda 7200.11 500 Gb Sata 300 Buffer 32 Mb 7200 Rpm |-| Sapphire HD 6950 2GB DDR5 |
![]() |
![]() |
![]() |
#18 |
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
per curiosita'
che vedi con: telnet smtp.FASTWEBNET.IT 25 o telnet <ip imap azienda> 143 |
![]() |
![]() |
![]() |
#19 |
Senior Member
Iscritto dal: May 2003
Messaggi: 1534
|
Sono ritornato all'inizio...non riesco a ricevere dagli imap che dovrebbero passare dalla wifi :-(
Se faccio traceroute con imap e smtp fastweb dopo aver fatto sudo route add "imap smtp" dev eth1 vedo che cercano di passare dalla wifi ma non riesco a pingare... Telnet su fastweb mi dice connection timeout.. telnet sull'imap aziendale tutto ok...
__________________
Intel e5450 |-| Dark Knight Xigmatek S1283 |-| Asus P5k SE/EPU |-| OCZ DDR2 PC2-6400 Platinum Revision 2 Dual Channel 4X1024MB 893Mhz |-| Seagate Barracuda 7200.11 500 Gb Sata 300 Buffer 32 Mb 7200 Rpm |-| Sapphire HD 6950 2GB DDR5 |
![]() |
![]() |
![]() |
#20 |
Senior Member
Iscritto dal: Apr 2004
Messaggi: 9516
|
a volte i server non rispondono ai ping
ma io ho: telnet smtp.FASTWEBNET.IT 25 Trying 85.18.95.132... Connected to smtp.FASTWEBNET.IT. Escape character is '^]'. 220 aa011-1msr.fastwebnet.it ESMTP Service ready ... proprio non riesci a uscire |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 02:20.