Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
port forwarding
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
lan
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 215
Location: Verona, Italy (Romeo & juliet`s City)

PostPosted: Thu Apr 29, 2004 12:31 pm    Post subject: port forwarding Reply with quote

allora...ho un piccolo problema: devo fare si che quando uno si connette alla mia linux box da internet la richiesta venga inoltrata su un altra macchina della lan (ps: la mia macchina è gateway)
allora:
iptables -A FORWARD -i ppp0 -o eth0 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 192.168.2.1:80

ok così però non va... dove sbaglio? pergo di non darmi il solito link di netfilter grazie a tutti e ciao

Beppe
_________________
--
http://www.giuseppe-marocchio.com
skype: l4nz0r /voice
USH team www.ush.it
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31284
Location: here

PostPosted: Thu Apr 29, 2004 12:39 pm    Post subject: Reply with quote

Prova a vedere qua se hai fatto tutti i passi.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
lan
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 215
Location: Verona, Italy (Romeo & juliet`s City)

PostPosted: Thu Apr 29, 2004 2:32 pm    Post subject: ... Reply with quote

no io non devo fare snat devo fare Dnat ....
_________________
--
http://www.giuseppe-marocchio.com
skype: l4nz0r /voice
USH team www.ush.it
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Thu Apr 29, 2004 2:45 pm    Post subject: Reply with quote

dovresti postare la tua config.

domanda scontata: il forwarding lo hai abilitato anche nell'altro senso?

ciao
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
lan
Apprentice
Apprentice


Joined: 06 Mar 2004
Posts: 215
Location: Verona, Italy (Romeo & juliet`s City)

PostPosted: Thu Apr 29, 2004 4:30 pm    Post subject: ... Reply with quote

ecco la mia conf corregetela pure...
Code:


jasmine lan # cat /usr/local/bin/firewall
#!/bin/bash
for table in nat mangle filter
do
  iptables -t $table -F
  iptables -t $table -X
done
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -s 192.168.0.2 -j ACCEPT
iptables -A INPUT -j LOG --log-prefix="INPUT:"
iptables -A OUTPUT -j LOG --log-prefix="OUTPUT:"
echo '0' > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo '1' > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp --dport 2020 -j DNAT --to 192.168.0.2:20
iptables -A FORWARD  -p tcp --dport 2020 -j ACCEPT

_________________
--
http://www.giuseppe-marocchio.com
skype: l4nz0r /voice
USH team www.ush.it
Back to top
View user's profile Send private message
pascalbrax
Apprentice
Apprentice


Joined: 21 Jan 2004
Posts: 280
Location: 127.0.0.1

PostPosted: Thu Apr 29, 2004 6:07 pm    Post subject: Reply with quote

se devi solo forwardare porte TCP, puoi usare rinetd, gira in user space ed e' facilissimo da configurare.

altrimenti puoi usare qualcosa tipo
Code:
iptables -A PREROUTING -p tcp -d ip.che.riceve.i.pacchetti --dport porta.che.vuoi.forwardare  -j DNAT -t nat --to ip.a.cui.devono.arrivare.i.pacchetti

_________________
"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler
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