Skip to contentSkip to conversation

foward ing specific ports

DISCUSSION riffraff 1 participant 1 message Jun 28, 2002

lore
Share & tools
lore

riffraff

author
#0 lore raw

---------- Original Message ----------------------------------
From: "Anthony Cesar" <[email protected]>
Date: Fri, 28 Jun 2002 16:55:54 -0400

Quoted 8 lines

is it possible to tell iptables to allow forwarding of specific ports that are staggered, in one entry? for example, i know that you can do a range of ports ( --sport 1024:65535) but what if i have only three ports like 25,110, and 53?

does the syntax allow for me to list these ports in just one chain (hypothetical: --sport 25-53-110)?

example:

iptables -A FORWARD -p tcp -m multiport -d 1.2.3.4 --dport 50,51,71,8101 -j ACCEPT

yes, you can, with the -m multiport --dport x,y,z options

Quoted 7 lines

or do i have to generate a chain for each one? it would help my typing fingers a lot if what i'm asking was possible....

--Anthony C--