Skip to contentSkip to conversation

Filter question

DISCUSSION Charles Lewis 2 participants 2 messages Feb 11, 2005

lore
Share & tools
lore
#0 lore raw

Hi all,

Have found tons of info on blocking a single ip address using iptables.

Can anyone suggest a place to find how-to ALLOW from single ip address (or block).

Using BusyBox & iptables 2.4. Wanting to allow port 25 traffic from 2 blocks & 1 explicit ONLY.

Thanks in advance!
Clewis
Pueblo, CO

#1 lore raw
Quoted 9 lines · Charles Lewis

Hi all,

Have found tons of info on blocking a single ip address using iptables.

Can anyone suggest a place to find how-to ALLOW from single ip address (or block).

Using BusyBox & iptables 2.4. Wanting to allow port 25 traffic from 2 blocks & 1 explicit ONLY.

Set the policy on the chain to DROP and then add ACCEPT rules for the IPs you want to allow. Example:

iptables -P INPUT DROP
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A INPUT -s 1.1.1.1 -p tcp -m tcp --dport 25 -j ACCEPT iptables -A INPUT -s 1.1.1.2 -p tcp -m tcp --dport 25 -j ACCEPT
...

You get the idea.

Signature · 2 lines
[ Tobias DiPasquale ]
0x636f6465736c696e67657240676d61696c2e636f6d