/* HINT: Search archives @ http://www.indyramp.com/masq/ before posting! */
Hi Thayne,
On <[EMAIL PROTECTED]>
Thayne Harbaugh wrote:
> I'm trying to port forward from one interface to another and
> I just can't make it work. On machine acid I want to forward
> a port from the network interface to the loopback interface.
>
> I've tried this:
> ipmasqadm portfw -a -P tcp -L acid 8888 -R localhost telnet
>
> ipmasqadm portfw -l shows the rule added
>
> for some reason, however, when I "telnet acid 8888" the
> forwarding doesn't work - I don't get a connection to the telnet
> service on acid.
>
> My simple mind just doesn't get it - can someone enlighten me?
I found the following code in
/usr/src/linux-2.2.13/net/ipv4/ip_masq.c .
ipmasq.c> int ip_fw_demasquerade(struct sk_buff **skb_p)
ipmasq.c> {
:
snip
:
ipmasq.c> /*
ipmasq.c> * Big tappo: only PACKET_HOST (nor loopback neither mcasts)
ipmasq.c> * ... don't know why 1st test DOES NOT include 2nd (?)
ipmasq.c> */
ipmasq.c>
ipmasq.c> if (skb->pkt_type != PACKET_HOST || skb->dev == &loopback_dev) {
ipmasq.c> IP_MASQ_DEBUG(2, "ip_fw_demasquerade(): packet type=%d
proto=%d
ipmasq.c> daddr=%d.%d.%d.%d ignored\n",
ipmasq.c> skb->pkt_type,
ipmasq.c> iph->protocol,
ipmasq.c> NIPQUAD(iph->daddr));
ipmasq.c> return 0;
ipmasq.c> }
I suppose the above code rejects masquerading packets whose
destination address is one of addresses assigned on the
local machine (including loopback address).
The portfw module of ipmasqadm depends on IP masqurade
function. Therefore I suppose that your effort doesn't work.
Could you find an entry in /var/log/kernmsg like following?
IP_MASQ:ip_fw_demasquerade(): packet type=0 proto=1 daddr=127.0.0.1 ignored
--
Ryoji Kobayashi
[EMAIL PROTECTED]
Riki Network Systems Inc.
_______________________________________________
Masq maillist - [EMAIL PROTECTED]
Admin requests can be handled at http://www.indyramp.com/masq-list/ -- THIS INCLUDES
UNSUBSCRIBING!
or email to [EMAIL PROTECTED]
PLEASE read the HOWTO and search the archives before posting.
You can start your search at http://www.indyramp.com/masq/
Please keep general linux/unix/pc/internet questions off the list.