Iptables config for mapping an OpenVPN IP address to a physical machine address.

This iptables config will map the 10.8.0.0 IP address to the 54.66.223.254 IP address range to enable the OpenVPN deamon to function. This is what I used when I was using OpenVPN to connect securely to a remote Amazon instance for access to a Linux virtual machine. # Generated by iptables-save v1.4.21 on Sun Feb … Read more

Iptables samples. Very good ways to filter network traffic.

Sample Iptables configurations A sample iptables output that I am using on an OpenVPN server to allow Internet traffic to be passed through it. ubuntu ~ $ sudo iptables-save # Generated by iptables-save v1.4.21 on Wed Aug 2 22:19:48 2017 *filter :INPUT ACCEPT [2654934:1228315333] :FORWARD ACCEPT [31023:17433690] :OUTPUT ACCEPT [2475842:555885003] COMMIT # Completed on Wed … Read more

How to have iptables entries applied on boot.

The iptables entries are lost upon reboot with a standard configuration, but this can be applied on boot with the right script. Create a script in the /etc/network/if-up.d directory named iptables. jason@hoshi:~$ sudo touch /etc/network/if-up.d/iptables [sudo] password for jason:jason@hoshi:~$ sudo touch /etc/network/if-up.d/iptables [sudo] password for jason: Put this in it. #!/bin/sh iptables-restore < /etc/iptables.conf#!/bin/sh iptables-restore … Read more

How to save your iptables firewall rules using the iptables-persistent package for Linux.

The iptables firewall is the built-in firewall for protecting a Linux machine from online threats. But the settings are not save upon a re-boot. This is easily alleviated by installing the iptables-persistent package for Ubuntu. Once this is installed, you will be greeted with a screen that will ask you if you wish to save … Read more

How to list all iptables rules that are set on your Linux system. This is very easy.

The iptables -L or iptables –list commands will list all of the iptables rules that are set on your Linux machine. Below is the abbreviated output of this command on my Fedora Linux system. [root@localhost homer]# iptables –list Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all — anywhere anywhere ctstate RELATED,ESTABLISHED ACCEPT … Read more

Using iptables on a Linux system to secure your computer against Internet threats. This is important.

Securing your Linux computer with iptables is a great way to make sure that you are safer from Internet attacks. The iptables(8) system is the built in firewall for a Linux system. This makes it very easy to secure your computer. Before you change any settings, backup your iptables configuration. iptables-save > backup.confiptables-save > backup.conf … Read more