[lungo] configurare un pc come router con pi [messaggio #38520] |
mar, 10 maggio 2011 12:35 ![Messaggio successivo Messaggio precedente](theme/adv/images/down.png) |
news.eternal-septembe Messaggi: 2 Registrato: maggio 2011 |
Junior Member |
|
|
ciao a tutti :),
ho installato una debian 6 , con il pacchetto iproute2
ho 2 interfacce di rete nominate (/etc/udev/rules.d/70-persistant-net.rules)
ethlan (traffico interno)
ethwan ( traffico esterno)
ho abilitato ip forwarding permanente con
nano /etc/sysctl.conf
net.ipv4.ip_forward = 1
ho modificato il file /etc/iproute2/rt_tables aggiungendo alla fine le
seguenti tabelle
100 fastweb
110 tiscali1
120 tiscali2
questo perché dispongo di tre connessioni adsl
fastweb -> 2 mega ip del router 192.168.42.1
tiscali1 -> 10 mega ip del router 192.168.42.250
tiscali2 -> 24 mega ip del router 192.168.42.249
in /etc/network
ho impostato il file interfaces così
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0
auto ethlan
iface ethlan inet static
address 192.168.100.70
netmask 255.255.255.0
auto ethwan
iface ethwan inet static
address 192.168.42.3
netmask 255.255.255.0
ed ho creato in /etc/network/if-up.d/
un file chiamato routing (impostato come eseguibile con chmod +x)
ip rule delete table tiscali1
ip rule delete table tiscali2
ip rule delete table fastweb
ip route add default via 192.168.42.250 table tiscali1
ip route add default via 192.168.42.1 table fastweb
ip route add default via 192.168.42.249 table tiscali2
ip route add 127.0.0.0/8 dev lo table tiscali1
ip route add 127.0.0.0/8 dev lo table fastweb
ip route add 127.0.0.0/8 dev lo table tiscali2
ip rule add from 192.168.100.98 table tiscali1 priority 100
ip rule add from 192.168.100.0/24 table fastweb priority 100
ip route add 192.168.100.0/24 dev ethlan table tiscali1
ip route add 192.168.100.0/24 dev ethlan table fastweb
ip route add 192.168.100.0/24 dev ethlan table tiscali2
route add default gw 192.168.42.1
nel file c'è una regola per un pc interno con ip 192.168.100.98
ma impostando sul pc il gateway come 192.168.100.70 non riesco a
navigare (il ping 192.168.100.70 viene eseguito senza errori, ping
8.8.8.8 mi da request time out)
ho anche riavviato :) :) :) :) :)! (sì provengo da windows :) )
ho anche eseguito manualmente il file routing ma niente
dove sbaglio??????
questo è l'output di alcuni comandi
ip rule show
0: from all lookup local
100: from 192.168.100.0/24 lookup fastweb2
100: from 192.168.100.0/24 lookup fastweb2
100: from 192.168.100.98 lookup tiscali10
100: from 192.168.100.0/24 lookup fastweb2
32766: from all lookup main
32767: from all lookup default
ip route show
192.168.100.0/24 dev ethlan proto kernel scope link src 192.168.100.70
192.168.42.0/24 dev ethwan proto kernel scope link src 192.168.42.3
default via 192.168.42.1 dev ethwan
ho visto che esiste anche un newsgroup debian ma mi è sembrato più
opportuno qua
visto che sono agli inizi, altrimenti se qui non va bene posto lì :)
grazie a tutti
ciao
|
|
|