* iptables REJECT NAT Internal -> External Portrange
@ 2006-09-27 16:11 Ryan Belcher
2006-09-27 16:30 ` Jan Engelhardt
2006-09-27 17:24 ` Nathaniel Hall
0 siblings, 2 replies; 5+ messages in thread
From: Ryan Belcher @ 2006-09-27 16:11 UTC (permalink / raw)
To: netfilter
Hi All,
I'm trying to set up a rule that will send an icmp-host-unreachable (or similar) back to the local machine (inside the NAT) if they try to connect to an external host on a specified port range.
I know I'm missing something obvious, but I can't seem to figure out what I'm missing.
iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 10000:11000 -j REJECT --reject-with icmp-host-unreachable
The above command returns with "Invalid Argument".
If I simply replace "-j REJECT --reject-with icmp-host-unreachabel" with "-j DROP" iptables accepts it.
What am I missing?
TIA!
Ryan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: iptables REJECT NAT Internal -> External Portrange
2006-09-27 16:11 iptables REJECT NAT Internal -> External Portrange Ryan Belcher
@ 2006-09-27 16:30 ` Jan Engelhardt
2006-09-27 16:43 ` Ryan Belcher
2006-09-27 17:24 ` Nathaniel Hall
1 sibling, 1 reply; 5+ messages in thread
From: Jan Engelhardt @ 2006-09-27 16:30 UTC (permalink / raw)
To: Ryan Belcher; +Cc: netfilter
>iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 10000:11000 -j REJECT --reject-with icmp-host-unreachable
>
>The above command returns with "Invalid Argument".
REJECT is to be used in -t filter.
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: iptables REJECT NAT Internal -> External Portrange
2006-09-27 16:30 ` Jan Engelhardt
@ 2006-09-27 16:43 ` Ryan Belcher
0 siblings, 0 replies; 5+ messages in thread
From: Ryan Belcher @ 2006-09-27 16:43 UTC (permalink / raw)
Cc: netfilter
Yeah, I figured that out while iteratively trying to get this to work. I guess I was using that command as more of a pseudocommand in the context of this email.
I've tried putting *roughly* the same rule into filter:OUTPUT filter:FORWARD and nat:PREROUTING and each time I either got a complaint from iptables or when I tried to modify the rule to "fit" into the above mentioned chains it never worked (matched any packets).
Do I have to bounce this packet from one table to another to get this to work?
>iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 10000:11000 -j REJECT --reject-with icmp-host-unreachable
>
>The above command returns with "Invalid Argument".
REJECT is to be used in -t filter.
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: iptables REJECT NAT Internal -> External Portrange
2006-09-27 16:11 iptables REJECT NAT Internal -> External Portrange Ryan Belcher
2006-09-27 16:30 ` Jan Engelhardt
@ 2006-09-27 17:24 ` Nathaniel Hall
2006-09-27 17:31 ` Ryan Belcher
1 sibling, 1 reply; 5+ messages in thread
From: Nathaniel Hall @ 2006-09-27 17:24 UTC (permalink / raw)
To: Ryan Belcher, netfilter
Ryan Belcher wrote:
> iptables -t nat -A PREROUTING -i eth2 -p tcp --dport 10000:11000 -j REJECT --reject-with icmp-host-unreachable
>
> The above command returns with "Invalid Argument".
>
> If I simply replace "-j REJECT --reject-with icmp-host-unreachabel" with "-j DROP" iptables accepts it.
Did this come with a distribution or have you compiled it on your own? I think I had a similar
problem with the iptables that came with Fedora Core because it didn't come with the REJECT module.
--
Nathaniel Hall, GSEC GCFW GCIA GCIH
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: iptables REJECT NAT Internal -> External Portrange
2006-09-27 17:24 ` Nathaniel Hall
@ 2006-09-27 17:31 ` Ryan Belcher
0 siblings, 0 replies; 5+ messages in thread
From: Ryan Belcher @ 2006-09-27 17:31 UTC (permalink / raw)
To: netfilter
I did compile it on my own, and the REJECT target is there (I tested it under different circumstances).
Ryan
>Did this come with a distribution or have you compiled it on your own? I think I had a similar
>problem with the iptables that came with Fedora Core because it didn't come with the REJECT module.
>
>--
>Nathaniel Hall, GSEC GCFW GCIA GCIH
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-09-27 17:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-27 16:11 iptables REJECT NAT Internal -> External Portrange Ryan Belcher
2006-09-27 16:30 ` Jan Engelhardt
2006-09-27 16:43 ` Ryan Belcher
2006-09-27 17:24 ` Nathaniel Hall
2006-09-27 17:31 ` Ryan Belcher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.