We can set several different configuration values for the iptables.
To flush the current rules we run the below command:
sudo /sbin/iptables -F
To accept a certain port, run the below:
sudo /sbin/iptables -A INPUT -i eth0 -p tcp -m tcp --dport 30000 -j ACCEPT
To accept certain state, run the below:
sudo /sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
We rejected all incoming and forwarded requests:
sudo /sbin/iptables -A INPUT -j REJECT
sudo /sbin/iptables -A FORWARD -j REJECT
Now accept all outgoing and selected incoming request:
sudo /sbin/iptables -A OUTPUT -j ACCEPT
sudo /sbin/iptables -I INPUT -i lo -j ACCEPT
Reject all incoming loop requests
sudo /sbin/iptables -I INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
It displays the existing rules with line numbers
sudo /sbin/iptables -L --line-numbers
We accept HTTP and HTTPS requests.
sudo /sbin/iptables -I INPUT 3 -p icmp -m icmp --icmp-type 8 -j ACCEPT
sudo /sbin/iptables -I INPUT 5 -p tcp --dport 80 -j ACCEPT
sudo /sbin/iptables -I INPUT 5 -p tcp --dport 443 -j ACCEPT
We enable the logging features of iptables.
sudo /sbin/iptables -I INPUT 8 -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
To save an existing rules table, use the below commands:
sudo sh -c '/sbin/iptables-save > /etc/iptables.save'
See the book
OpenCart 1.4 Template Design Cookbook.
See the book
Joomla Mobile Development Beginners Guide
List of my works:
Technical Support:
If you still face the technical problem, please get support of our highly skilled technical team: garazlab.com.
Wordpress Plugins:
- Real-Time Health Data from Every Where:WP plugin to display real-time health data & increase sale by promoting user specific products according to health information: garazlab.com.
- Woocommerce Stock Notification Builder:Sends desktop, mobile & email notifications with full customization.Build your own product notification system with it: garazlab.com.
Opencart Extensions:
- Product Based Quantity Wise Shipping: Find it here.
- OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
- Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
- Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
- Custom Field Product - add unlimited custom fields to the product form: Find it here.
- Formcaptcha - add captcha on the register page: Find it here.
My Books:
- OpenCart 1.4 Template Design Cookbook.
- Joomla Mobile Development Beginners Guide