Small port forwarding problem

From: Craig Kadziolka (c_kadziolka_no.spam_at_interia.pl)
Date: 04/14/04


Date: Wed, 14 Apr 2004 22:07:47 +0200

Hello,

I am having a small problem with my port forwarding setup on my
computer. I essentially want to forward incoming connections to my
linux server to a port on a local machine behind the server. I have read
that this is a quite common thing to do.

I was having some problems with getting that working, so i decided
to test the idea on my stand-alone machine, just using the local loopback.

I want to forward incomming connections to an arbitary port (say, 4444)
to port 23, which (according to my limited theory of the internet) should
mean
that I can get to my telnet service on my local machine via port 4444.

After reading several sources, I set about this task, but I cant seem to get
it working. My setup is this: Slackware 9.0 (a fresh install) with a 2.4
kernel.

My iptables command was this:

iptables -t nat -A PREROUTING -p tcp -j DNAT --dport 4444 --to-destination
127.0.0.1:23

I would really appreciate any help anyone could give me.

Following is attached some lists from iptables, route, ifconfig, and what
modules are loaded.

Thanks in advance,

Craig.

output from "iptables -L"

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

output from "iptables -L -t nat"

Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DNAT tcp -- anywhere anywhere tcp dpt:krb524
to:127.0.0.1:23

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
loopback * 255.0.0.0 U 0 0 0 lo

output from "ifconfig"

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:189 errors:0 dropped:0 overruns:0 frame:0
          TX packets:189 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:11227 (10.9 Kb) TX bytes:11227 (10.9 Kb)

modules loaded:
arp_tables 9132 0 (unused)
iptable_filter 1644 0 (autoclean) (unused)
iptable_nat 15928 1 (autoclean)
ip_conntrack 18120 1 (autoclean) [iptable_nat]
ip_tables 12288 4 [iptable_filter iptable_nat]
snd-pcm-oss 37252 0 (unused)
snd-mixer-oss 11992 0 [snd-pcm-oss]
printer 7040 0 (unused)
parport_pc 14724 0
parport 23264 0 [parport_pc]
uhci 24496 0 (unused)
usbcore 58400 1 [printer uhci]
snd-via82xx 11712 0
snd-pcm 55904 0 [snd-pcm-oss snd-via82xx]
snd-timer 13252 0 [snd-pcm]
snd-ac97-codec 37240 0 [snd-via82xx]
snd-page-alloc 6004 0 [snd-via82xx snd-pcm]
snd-mpu401-uart 3136 0 [snd-via82xx]
snd-rawmidi 12512 0 [snd-mpu401-uart]
snd-seq-device 3920 0 [snd-rawmidi]
snd 27460 0 [snd-pcm-oss snd-mixer-oss snd-via82xx
snd-pcm snd-timer snd-ac97-codec snd-mpu401-uart snd-rawmidi snd-seq-device]
soundcore 3332 3 [snd]
ide-scsi 9424 0
agpgart 39576 0 (unused)



Relevant Pages

  • Re: iptables fubared?
    ... If I DON'T have traffic on port 8080, I have problems with iptables. ... Chain FORWARD (policy ACCEPT) ...
    (Fedora)
  • Re: iptables fubared?
    ... run tcpdump and then try externally connecting: ... If you get traffic on port 8080 then you have an iptables problem. ... Chain FORWARD (policy ACCEPT) ...
    (Fedora)
  • Re: Iptables not saving...
    ... Chain FORWARD (policy ACCEPT) ... Chain OUTPUT ... You want to direct its output to where iptables normally ...
    (Fedora)
  • Re: Iptables not saving...
    ... Chain FORWARD (policy ACCEPT) ... Chain OUTPUT ... You want to direct its output to where iptables normally ...
    (Fedora)
  • Re: RPCemu vs. VRPC
    ... Chain FORWARD (policy ACCEPT) ... Chain OUTPUT ... And if I re-generated the iptables command after RPCEmu is running, ...
    (comp.sys.acorn.misc)