[ale] portforwarding on linux

George Allen glallen01 at gmail.com
Wed Mar 6 17:05:52 EST 2013


Maybe something similar to:

# anything incoming push to 8080 if you want to redirect outside
connections, not clear if you want this or just local
iptables -t nat -A PREROUTING -i enp0s3 -p tcp
--dport 19080 -j REDIRECT --to-ports 8080

# redirect anything outbound on localhost to 19080 to 8080
iptables -t nat -A OUTPUT          -p tcp -s 127.0.0.1 -d 127.0.0.1
--dport 19080 -j REDIRECT --to-ports 8080

Not sure if it works, I'd have to sit down at home to try this.
There are many many howtos and references:
http://netfilter.org/documentation/index.html#documentation-howto

On Wed, Mar 6, 2013 at 4:26 PM, Narahari 'n' Savitha
<savithari at gmail.com> wrote:
> Friends:
>
> I want to forward port 19080 to 8080 on my local arch box ?
>
> Is there a simple way to do this.  I googled it and I see something called
> iptables but it is too hairy to learn.
>
> Can any expert here break it down for me as to what all is involved.
>
> I should be able to say traffic on port 19080 forward to port 8080 on the
> same ip.
>
> My ifconfig results are
>
> [devusr at ARCH64-TOMCAT-DEV-MACHINE WEB-INF]$ ifconfig
> enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
>         inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
>         inet6 fe80::a00:27ff:fea6:8c98  prefixlen 64  scopeid 0x20<link>
>         ether 08:00:27:a6:8c:98  txqueuelen 1000  (Ethernet)
>         RX packets 128271  bytes 36766353 (35.0 MiB)
>         RX errors 0  dropped 0  overruns 0  frame 0
>         TX packets 99743  bytes 11777820 (11.2 MiB)
>         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
>
> lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
>         inet 127.0.0.1  netmask 255.0.0.0
>         inet6 ::1  prefixlen 128  scopeid 0x10<host>
>         loop  txqueuelen 0  (Local Loopback)
>         RX packets 25378  bytes 38050755 (36.2 MiB)
>         RX errors 0  dropped 0  overruns 0  frame 0
>         TX packets 25378  bytes 38050755 (36.2 MiB)
>         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
>
> -Narahari
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>


More information about the Ale mailing list