This shows you the differences between two versions of the page.
docs:port_forwarding [2010-04-26 13:34] Mateusz Korniak my notes about portforward |
docs:port_forwarding [2010-04-26 14:18] glen do not advertise direct invocation |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
- | |||
- | ===== Contents ===== | ||
- | /* UndefinedMacro: TableOfContents(None) */ | ||
- | |||
- | |||
- | |||
- | ===== Problem ===== | ||
- | We want on host 11.1.1.111 connections on port 11111 to be forwareded to host 2.2.22.222 to port 2222. | ||
- | |||
- | |||
- | |||
- | ===== Simple port forwarding using using portfwd ===== | ||
- | On host 11.1.1.111 install: | ||
- | |||
- | |||
- | |||
- | <file>poldek:/all-avail> install portfwd-0.29-1.i686 | ||
- | </file> | ||
- | Edit '/etc/portfwd.cfg' and add: | ||
- | |||
- | <file>/* Comment what kind of forward it is */ | ||
- | tcp { 11111 { => 2.2.22.222:2222 } } | ||
- | </file> | ||
- | Enable incoming connections to 11.1.1.111:11111 if you are using iptables firewall: | ||
- | |||
- | <file>iptables -I INPUT -p tcp --dport 11111 -j ACCEPT | ||
- | </file> | ||
- | and perhaps outgoing connections to 2.2.22.222:2222. | ||
- | |||
- | Start '/etc/init.d/portfwd', set it to start up permanently ('ntsysv'). | ||
- | |||
- | Check forwarded traffic going: | ||
- | |||
- | <file>tcpdump -i eth1 host 2.2.22.222 and port 2222 | ||
- | </file> | ||