From the course: Protecting Your Network with Open Source Software

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Changing Netfilter settings

Changing Netfilter settings

From the course: Protecting Your Network with Open Source Software

Start my 1-month free trial

Changing Netfilter settings

- Next, we'll change the Netfilter rules on our Ubuntu router host to finish our configuration for forwarding packets between the internet and the Ubuntu local host. We'll use a shell script instead of typing individual commands. I keep my shell script in the documents folder type cd Documents, press Enter. Type ls, press Enter. The myfw.sh file is our shell script. Let's open the shell script by typing nano space myfw.sh, press Enter. The rules you are seeing here are the default Netfilter ones, introduced in our host firewall lesson. I added a couple of more rules to the input chain to prevent losing my remote desktop and secure shell connections. - p tcp, specifies the transmission control protocol or tcp used by a remote desktop or secure shell request. - s 04/0 indicates the scope of the source IPs, which covers all the possible incoming IP addresses. - d 04/0 is the same, except for it's for destination IPs.…

Contents