From the course: Protecting Your Network with Open Source Software
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Automating Netfilter configuration
From the course: Protecting Your Network with Open Source Software
Automating Netfilter configuration
- [Instructor] It's cumbersome, to keep typing IP tables commands, into our command line interface or CLI. You can automate this process by creating a shell script. We'll start by creating a file for the shell script. Let's first change our working directory to Documents by typing cd Documents. Press Enter. Type nano, space, the name of the file, which is M-Y-F-W, standing for my firewall dot S-H. Press Enter, nano is one of the pre-installed Linux text editors. Let's start by typing iptables space dash P meaning the default firewall rule, space INPUT for all the incoming traffic. We'll be dropping all the incoming traffic which is why we type DROP next. Now the second rule is for the outgoing traffic. The net filter chain for that is output. We allow all the outgoing traffic which is why we type iptables, space, dash P, OUTPUT, space, ACCEPT. Press Enter. Next type iptables, space dash P space FORWARD. The…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Netfilter and iptables3m
-
Setting up a host firewall using iptables5m 24s
-
(Locked)
Automating Netfilter configuration5m 17s
-
(Locked)
Understanding hosts as routers2m 30s
-
(Locked)
Adding a network adapter3m 49s
-
(Locked)
Testing the second adapter2m 20s
-
(Locked)
Setting up IP forwarding3m 55s
-
(Locked)
Changing Netfilter settings6m 37s
-
(Locked)
Testing the router1m 21s
-
(Locked)
-
-
-
-
-