Skip to contentSkip to conversation

iptables REDIRECT with patch-o-matic

DISCUSSION Rohan Almeida 2 participants 2 messages Sep 13, 2002

lore
Share & tools
lore
#0 lore raw

Hi List,

Take the following command:

[rohan@sanitarium rohan]$ iptables -t nat -i eth0 -A PREROUTING \
			--protocol tcp -s 10.0.0.0/255.255.255.0 \
			-d 10.0.0.1/32 --dport www -j REDIRECT \
			--to-port 800

With redhat rpms, kernel-2.4.18-5, iptables-1.2.5-3 the above command works fine.

Now, i downloaded iptables-1.2.7a, patch-o-matic-20020825 and using kernel source tree of 2.4.18
I applied the following patches of patch-o-matic:
base AND extra

Then i compiled the kernel.
Now with this patched kernel and iptables-1.2.5-3 rpm, I am getting the following error when running the above command:
"iptables: Invalid argument"

What am i doing wrong?

If i just have to upgrade my iptables to 1.2.7a, then i'm sorry for posting this :-)

Thanx

--
arc_of_descent

#1 lore raw
Quoted 21 lines · Rohan Almeida

Hi List,

Take the following command:

[rohan@sanitarium rohan]$ iptables -t nat -i eth0 -A PREROUTING \
			--protocol tcp -s 10.0.0.0/255.255.255.0 \
			-d 10.0.0.1/32 --dport www -j REDIRECT \
			--to-port 800

With redhat rpms, kernel-2.4.18-5, iptables-1.2.5-3 the above command works fine.

Now, i downloaded iptables-1.2.7a, patch-o-matic-20020825 and using kernel source tree of 2.4.18
I applied the following patches of patch-o-matic:
base AND extra

Then i compiled the kernel.
Now with this patched kernel and iptables-1.2.5-3 rpm, I am getting the following error when running the above command:
"iptables: Invalid argument"

Quoted 4 lines

What am i doing wrong?

If i just have to upgrade my iptables to 1.2.7a, then i'm sorry for posting this :-)

Yes, I think that will fix your problem.

When you compile and install iptables, pay attention that the default installation will be in /usr/local/sbin, whereas RH defaults their installation to /sbin.

For this reason, don't forget to uninstall iptables-1.2.5 (rpm -e iptables), or you will still be running "/sbin/iptables" (the old version). instead of "/usr/local/sbin/iptables" (the new version).

You may also compile iptables-1.2.7a to install in /sbin of course (see Makefile).

In case of doubt, run "whereis -b iptables" to get a list of all iptables-binaries in your system..

Signature · 3 lines
Z.
----------------------------------------------------------
"If all you have is a hammer, everything looks like a nail."