Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Conf] Firewall + Router + 2 schede di rete[RISOLTO]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
TeoBì
Apprentice
Apprentice


Joined: 31 May 2004
Posts: 150

PostPosted: Thu Oct 28, 2004 8:40 pm    Post subject: [Conf] Firewall + Router + 2 schede di rete[RISOLTO] Reply with quote

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
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Thu Oct 28, 2004 9:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
TeoBì
Apprentice
Apprentice


Joined: 31 May 2004
Posts: 150

PostPosted: Thu Oct 28, 2004 9:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Thu Oct 28, 2004 9:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
comio
Advocate
Advocate


Joined: 03 Jul 2003
Posts: 2191
Location: Taranto

PostPosted: Thu Oct 28, 2004 10:21 pm    Post subject: Reply with quote

abilita l'ip_forwarding:

Code:

echo "1" > /proc/sys/net/ipv4/ip_forward

_________________
RTFM!!!!

e

http://www.comio.it
:)
Back to top
View user's profile Send private message
TeoBì
Apprentice
Apprentice


Joined: 31 May 2004
Posts: 150

PostPosted: Fri Oct 29, 2004 9:34 am    Post subject: Reply with quote

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
View user's profile Send private message
TeoBì
Apprentice
Apprentice


Joined: 31 May 2004
Posts: 150

PostPosted: Sat Oct 30, 2004 1:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum