Whitelist IP or IP range in/out using iptables

#Flush existing rules iptables -F # Set up default DROP rule for eth0 (Assuming eth0 is the Ethernet Port) iptables -P INPUT DROP # Allow existing connections to continue iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT # Accept everything from the 192.168.0.x network iptables -A INPUT -i eth0 -s 192.168.0.0/24 -j…

Continue reading

How to find the IP addresses of a Linux system

The following command in a linux based system will show all the IPs assigned to that system: # ip addr show Or alternatively, if you'd like to know the IP address(es) of a certain port (for example eth0) type the following: # ip addr show eth0 Sample output: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state…

Continue reading