View Full Version : Linux + 2 schede di rete+switch
slacky82
27-09-2006, 15:20
Salve a tutti avendo fastweb non posso collegare + di 2 pc, ho montato slackware su un vecchio pc con 2 schede di rete, su una volevo metterci il router sulla seconda uno switch. Potreste dirmi come configurare le due schede.
:banned:
io le ho impostate così
auto eth0 # scheda collegata al router
iface eth0 inet static
address 29.244.**.*** # ip fastweb
netmask 255.255.248.0
gateway 29.244.80.1
dns-nameservers 29.253.128.11
auto eth1 # scheda collegata allo switch
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
per condividere la connessione faccio un masquerade con iptables
$IPTABLES -t nat -A POSTROUTING -s eth1 -o eth0 -j MASQUERADE
slacky82
27-09-2006, 18:36
mi da questo errore eth1: not found
eertreEnrerterticerto_ereert8erter1
27-09-2006, 19:38
mi da questo errore eth1: not found
Le schede di rete sono uguali? Ti da l'errore perché non trova la seconda scheda di rete. Lancia da console lspci e vedi se le riconosce entrambe.
slacky82
27-09-2006, 20:23
Le schede di rete sono uguali? Ti da l'errore perché non trova la seconda scheda di rete. Lancia da console lspci e vedi se le riconosce entrambe.
Adesso partono ho fatto il file dhcd.conf così :
# dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
#
ddns-update-style ad-hoc;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.50 192.168.1.5;
default-lease-time 604800;
max-lease-time 2592000;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.10;
option domain-name-servers 192.168.1.1;
option domain-name "fastwebnet.it";
}
~
Ma adesso se provo a fare la richiesta del dhcp da un altro pc si blocca tutto!!!
Il server non risponde e non naviga nemmeno , la luce della scheda di rete dove è collegato il pc e sempre accesa fissa!!!!!!!!
slacky82
01-10-2006, 09:40
up
1. i pc collegati allo switch devono avere ip statico( oppure abilita il server dhcp su linux...)
2. devi abilitare il forwarding nel kernel
3. devi usare iptables per il mascheramento (MASQUERADING)
4. mettere il gateway giusto (la scheda che va allo switch ha come gw quello che va a fastweb)
dovrebbe funzionare... :D
Psycotic
01-10-2006, 11:34
IPTABLES -t nat -A POSTROUTING -s eth1 -o eth0 -j MASQUERADE
con -s dovresti specificare l'indirizzo sorgente(192.168.0.0/24)
X abilitare il forrwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.