Block all traffic incoming to your server with -d / –dport (destination port)
iptables -I FORWARD -p tcp -d 101.102.103.4 –dport 25 -j DROP;
The result will look like this in iptables:
[screenshot of the Source .. Destination .. Protocol info colums]
Run iptables-save to save this configuration if/when iptables is reloaded.
Block all traffic outgoing from your server with -s / –sport (sending port)
iptables -I FORWARD -p tcp -s 101.102.103.4 –sport 25 -j DROP
Do it for an entire IP range/subnet/network [keywords]
iptables -I FORWARD -p tcp -s 101.102.103.0/24 –sport 25 -j DROP

Lightning-fast VPS hosting with enterprise SSD storage, global data centers, and 99.99% uptime. Built for developers, trusted by enterprises.
support@solvps.com
1-888-256-8213
Live Chat Now