View previous topic :: View next topic |
Author |
Message |
TeoBì Apprentice
Joined: 31 May 2004 Posts: 150
|
Posted: Thu Oct 28, 2004 8:40 pm Post subject: [Conf] Firewall + Router + 2 schede di rete[RISOLTO] |
|
|
Salve ragazzi, ho la seguente rete con il server linux che voglio faccia da firewall con due schede di rete, una collegata al router e una collegata all'hub e quindi alla rete interna:
Code: |
+--------+
|Internet|
+----+---+
|
|
IP |pubblico
+----+------+
|Router ADSL+-------------+
+-----------+10.0.0.254 |
IPprivato |
|
|
|10.0.0.1| eth1
+---+----+
|Gateway |
|e server |
| Linux |
+---+----+-------
|192.168.1.254 |eth0 Ip Rete Privata
+-------+----------
|
|Hub/Switch
|
+------------+----------+------------- +------------
| |
|192.168.1.101| |192.168.1.102|
+---+----+ +---+----+-----
| client | | client |
+--------+ +--------------+
|
Ho qualche problema ha settare il firewall.
Nel file /etc/conf.d/net ho settato come gatway 10.0.0.254, ho settato nel file resolv.conf i dns e il server infatti esce in internet. Poi ho settato nel firewall la seguente regola:
Code: |
iptables -A POSTROUTING -t nat -s 192.168.1.0/8 -o 10.0.0.254 -j MASQUERADE
|
il problema è che i client vedono il server ma non escono in internet. Avete qualche idea su dove sbaglio?
Grazie in anticipo per l'aiuto
Last edited by TeoBì on Sat Oct 30, 2004 1:32 pm; edited 1 time in total |
|
Back to top |
|
|
FonderiaDigitale Veteran
Joined: 06 Nov 2003 Posts: 1710 Location: Rome, Italy
|
Posted: Thu Oct 28, 2004 9:28 pm Post subject: |
|
|
sintassi errata.
Code: | iptables -A POSTROUTING -t nat -s 192.168.1.0/24 -o eth0 -j MASQUERADE |
_________________ Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica
|
|
Back to top |
|
|
TeoBì Apprentice
Joined: 31 May 2004 Posts: 150
|
Posted: Thu Oct 28, 2004 9:34 pm Post subject: |
|
|
Code: |
iptables -A POSTROUTING -t nat -s 192.168.1.0/24 -o eth0 -j MASQUERADE
|
Ok ci sono, ho sbaligato il netmask , però non dovrebbere essere eth1 che è l'interfaccia di rete collegata al router? |
|
Back to top |
|
|
FonderiaDigitale Veteran
Joined: 06 Nov 2003 Posts: 1710 Location: Rome, Italy
|
Posted: Thu Oct 28, 2004 9:39 pm Post subject: |
|
|
si, ma i pacchetti dalla lan arrivano e escono dall'interfaccia eth1. o no? _________________ Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica
|
|
Back to top |
|
|
comio Advocate
Joined: 03 Jul 2003 Posts: 2191 Location: Taranto
|
Posted: Thu Oct 28, 2004 10:21 pm Post subject: |
|
|
abilita l'ip_forwarding:
Code: |
echo "1" > /proc/sys/net/ipv4/ip_forward
|
_________________ RTFM!!!!
e
http://www.comio.it
|
|
Back to top |
|
|
TeoBì Apprentice
Joined: 31 May 2004 Posts: 150
|
Posted: Fri Oct 29, 2004 9:34 am Post subject: |
|
|
Ho provato ad attivare l'ip_routing con
Code: |
echo "1" > /proc/sys/net/ipv4/ip_forward
|
e ho provato con la stringa
Code: |
iptables -A POSTROUTING -t nat -s 192.168.1.0/24 -o eth0 -j MASQUERADE
|
ma nulla da fare. Il server vede internet e i client no. |
|
Back to top |
|
|
TeoBì Apprentice
Joined: 31 May 2004 Posts: 150
|
Posted: Sat Oct 30, 2004 1:32 pm Post subject: |
|
|
Grazie a tutti ragazzi per le indicazioni date, alla fine ho risolto con la seguente riga di firewall:
iptables -A POSTROUTING -t nat -o eth1 -j MASQUERADE
Saluti a tutti. |
|
Back to top |
|
|
|