Knowing how to Whitelist and Blacklist IPs in your firewall can be very important when you want to allow or deny connection to your server, based on an IP address. Below we will cover how to allow and deny connections…
Category: Iptables
Check if port is open or blocked in iptables
# iptables -L -n # iptables -L -n | grep :PORT
Change IP route for Blacklist
Add the clean IP to the server. Edit the firewall to NAT all connections FROM port 25 to use the new IP. # iptables -t nat -A POSTROUTING -p tcp –dport 25 -j SNAT –to-source NEW.IPA.DDR.ESS # service iptables save…
Cloud Server Iptables rejects port 80 CentOS 6.5
I have just intalled apache on a fresh CentOS 6.5 installation. I entered the ip address in the browser address bar, and it failed to connect. I then turned off iptables, and refeshed, and this time I could connect. So…
Block IP with iptables
Block Incoming Request From IP 1.2.3.4 The following command will drop any packet coming from the IP address 1.2.3.4: # /sbin/iptables -I INPUT -s {IP-HERE} -j DROP # /sbin/iptables -I INPUT -s 1.2.3.4 -j DROP Finally, the last thing we…
Check if IP blocked in iptables
Is an IP blocked? # iptables –list -n | grep 76.88.xx.xx
Stop Spam and http access with IPtables
To stop Spam: drop SMTP on port 25, 465 and 587 to prevent further spam from being sent out by running the following commands: # /sbin/iptables -A INPUT -p tcp –dport 25 -j DROP # /sbin/iptables -A OUTPUT -p tcp…
Add/Drop IP in iptables on cPanel server
on cpanel, use iptables -A cP-Firewall-1-INPUT -s 203.90.xxx.xxx -j DROP
Add IP and Port to iptables
How to add an IP to access the plesk panel and ssh Open flle /etc/sysconfig/iptables: # nano /etc/sysconfig/iptables -A INPUT -s 72.177.xxx.xxx/32 -p tcp -m tcp –dport 8443 -j ACCEPT -A INPUT -s 66.226.xx.xx/32 -p tcp -m tcp –dport 10222…