Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables port 8080 forwarding lukt niet. [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Dutch
View previous topic :: View next topic  
Author Message
wouzer
Tux's lil' helper
Tux's lil' helper


Joined: 11 Feb 2003
Posts: 88
Location: The Hague, The Netherlands

PostPosted: Sat Mar 11, 2006 11:36 am    Post subject: iptables port 8080 forwarding lukt niet. [solved] Reply with quote

Ik heb een probleem met port forwarding in iptables.
Ik heb een Gentoo machine rechtstreeks op mijn ADSL modem staan. De modem heeft alle poorten open staan. Op de gentoo machine draait iptables.

Op de Gentoo machine draaien ook apache, gnump3d en ssh. Dit werkt perfect en alle overige poorten worden netjes geblocked. Wat ik nu graag wil is dat poort 8080 wordt geforward naar mijn winXP machine (192.168.0.3). Mijn win XP machine heeft geen firewall draaien en intern werkt de webserver (IIS5) prima.

Als ik van buiten probeer te connecten via poort 8080, lukt dit niet. Ik begrijp echter niet waarom. Heeft iemand enig idee?

eth0 = Internet
eth1 = macOSX
eth2 = winXP machine

Dit is mijn iptables script dat ik in een text file heb gezet en telkens run na een reboot (local.start):

Code:
#!/bin/bash
IPTABLES='/sbin/iptables'

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

$IPTABLES -F
$IPTABLES -X

$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -P FORWARD ACCEPT
$IPTABLES -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A INPUT -i eth2 -j ACCEPT
$IPTABLES -A INPUT -i eth1 -j ACCEPT
$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -t nat -A POSTROUTING -o eth0 -j MASQUERADE
$IPTABLES -t nat -A PREROUTING -i eth0 -p tcp --dport 8080 -j DNAT --to 192.168.0.3:80

#port rules
$IPTABLES -A INPUT -p tcp --dport 22 -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 80 -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 8080 -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 8888 -j ACCEPT

_________________
It is better to keep your mouth closed and let people think you are a fool than to open it and remove all doubt. (Mark Twain)


Last edited by wouzer on Wed Mar 15, 2006 6:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
VeXocide
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jul 2004
Posts: 131
Location: Netherlands, the

PostPosted: Tue Mar 14, 2006 2:18 pm    Post subject: Reply with quote

1) Iptables kun "mooier" starten:
eenmalig #rc-update add iptables default
daarna, zodra je iets wijzigd, en je weet dat het werkt:
#/etc/init.d/iptables save
#/etc/init.d/iptables restart

als je het niet eerst saved dan ben je na een reboot terug in je oorspronkelijke situatie.

2) Kijk eens naar de portfwd daemon, en wat je wil is in principe een proxy als ik me niet vergis, daar zal vast wel een programma zijn die daar speciaal voor is gemaakt.
Back to top
View user's profile Send private message
wouzer
Tux's lil' helper
Tux's lil' helper


Joined: 11 Feb 2003
Posts: 88
Location: The Hague, The Netherlands

PostPosted: Tue Mar 14, 2006 8:07 pm    Post subject: Reply with quote

VeXocide,
Dank voor je suggestie. iptables staat al in runlevel default. Ook weet ik dat ik de state kan saven. Voor snelle wijzigingen vindt ik het echter makkelijk om gebruik te maken van mijn scriptje. Als dat goed werkt doe ik alsnog een save.

Een proxy is niet wat ik wil. Ik wil dat als ik van af mijn werk surf naar mijn IP-adres thuis, ik op mijn Linux bak beland (PHP), maar als ik dat doe via poort 8080, ik op mijn Windows bak beland (.NET). Volgens mij is een proxy server in deze nutteloos.
_________________
It is better to keep your mouth closed and let people think you are a fool than to open it and remove all doubt. (Mark Twain)
Back to top
View user's profile Send private message
garo
Bodhisattva
Bodhisattva


Joined: 15 Jul 2002
Posts: 860
Location: Edegem,BELGIUM

PostPosted: Wed Mar 15, 2006 7:42 am    Post subject: Reply with quote

Ik kan de fout niet zo direct vinden, maar gebruik ethereal of tcpdump is om de pakketten te bekijken, dit kan helpen om de fout op te sporen.
_________________
My favorite links this month:
- Surf Random
- Web-based SSH
- Stop Spam


Last edited by garo on Wed Mar 15, 2006 11:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
wouzer
Tux's lil' helper
Tux's lil' helper


Joined: 11 Feb 2003
Posts: 88
Location: The Hague, The Netherlands

PostPosted: Wed Mar 15, 2006 6:15 pm    Post subject: Reply with quote

Ik heb zo'n donkerbruin vermoeden dat mijn provider poort 80 heeft dicht gegooid. Ik kan nu ook ineens niet meer op mijn Linux bak komen vanaf buiten :(

Dank voor alle hulp in elk geval.
_________________
It is better to keep your mouth closed and let people think you are a fool than to open it and remove all doubt. (Mark Twain)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Dutch 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