Save Time & improve Grades
- Questions Asked
- Experts
- Total Answered
Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!
For this lab exercise, we will be using two machines, one machine will behave like an Enterprise and the other machine will behave like machines outside an enterprise. We will these machines as External, external to the enterprise. The firewall, as part of the enterprise will control traffic both coming into the enterprise and going out of the enterprise (to External).
Although there are only two machines, we are going to pretend that the Enterprise has three machines (three IP addresses) and each machine has certain services running on those machines, as follows:
NIXENT01 (Enterprise)
Service |
Associated IP Address |
domain, telnet |
192.168.10.10 |
http, https |
192.168.10.20 |
ftp, imap2, imaps, pop3, pop3s, urd |
192.168.10.30 |
Similarly, we are going to emulate three machines on the External machine with three IP addresses, each running only certain services as follows:
NIXEXT01 (External)
Service |
Associated IP Address |
domain, telnet |
192.168.10.210 |
http, https |
192.168.10.220 |
ftp, imap, imaps, pop3, pop3s, urd |
192.168.10.230 |
*Please Note* Allocated lab resources expire in 7 days. If a lab expires, work done within the lab machine.
The Network traffic Simulation script allows users to test pathways to lab resource machines by using the terminal to initiate test packets. The script takes 2 input variables (IP address and service) and uses this information to initiate a test. The script is implemented using bash shell. The script accepts a target IP (-t) and any service name (-s) available in /etc/services
To run the script:
EXAMPLE: Incoming traffic to Enterprise on http port not allowed |
StudentFirst@infa620-nixext01:~$ sudo /usr/local/sbin/traffic_test -t 192.168.10.20 -s http [sudo] password for StudentFirst: HPING 192.168.10.20 (daaslab 192.168.10.20): S set, 40 headers + 0 data bytes
--- 192.168.10.20 hping statistic --- 5 packets transmitted, 0 packets received, 100% packet loss round-trip min/avg/max = 0.0/0.0/0.0 ms StudentFirst@infa620-nixext01:~$ |
Adding inbound rules to daaslab zone |
|
[StudentFirst@infa620-nixent01 ~]$ sudo firewall-cmd --zone=daaslab --add-rich-rule='rule family="ipv4" destination address="192.168.10.20/32" port protocol="tcp" port="80" accept’ [StudentFirst@infa620-nixent01 ~]$ password for StudentFirst: Success
You can verify whether a rule was added as follows: [StudentFirst@infa620-nixent01 ~]$ sudo firewall-cmd --zone=daaslab --list-rich-rules rule family="ipv4" destination address="192.168.10.20/32" port port="80" protocol="tcp" accept [StudentFirst@infa620-nixent01 ~]$ |
EXAMPLE: Incoming traffic to Enterprise on http port is now allowed |
StudentFirst@infa620-nixext01:~$ sudo /usr/local/sbin/traffic_test -t 192.168.10.20 -s http [sudo] password for StudentFirst: HPING 192.168.10.20 (daaslab 192.168.10.20): S set, 40 headers + 0 data bytes len=44 ip=192.168.10.20 ttl=64 DF id=0 sport=80 flags=SA seq=0 win=29200 rtt=3.9 ms len=44 ip=192.168.10.20 ttl=64 DF id=0 sport=80 flags=SA seq=1 win=29200 rtt=3.8 ms len=44 ip=192.168.10.20 ttl=64 DF id=0 sport=80 flags=SA seq=2 win=29200 rtt=3.7 ms len=44 ip=192.168.10.20 ttl=64 DF id=0 sport=80 flags=SA seq=3 win=29200 rtt=3.6 ms len=44 ip=192.168.10.20 ttl=64 DF id=0 sport=80 flags=SA seq=4 win=29200 rtt=3.5 ms
--- 192.168.10.20 hping statistic --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 3.5/3.7/3.9 ms StudentFirst@infa620-nixext01:~$ |
As you can see, the inbound http traffic to 192.168.10.20 has been enabled.
On your own now, configure rules to allow the following nine services (45 Points):
https to 192.168.10.20
domain and telnet to 192.168.10.1 0
ftp, imap2, imaps, pop3, pop3s, and urd to 192.168.10.30
Domain is often known as DNS (Domain Name Service). You should be able to google port numbers for various services.
Before you configure, first make sure, using the test script given, these traffic types are not allowed to the respective hosts. After configuring them, make sure they are allowed to the respective hosts. Also, verify that the rules were added using sudo firewall-cmd --zone=daaslab --list-rich-rules. There should be one rule for each service added. If you have done correctly, this is what will be listed:
rule family="ipv4" destination address="192.168.10.20/32" port port="80" protocol="tcp" accept
rule family="ipv4" destination address="192.168.10.20/32" port port="443" protocol="tcp" accept
rule family="ipv4" destination address="192.168.10.10/32" port port="23" protocol="tcp" accept
rule family="ipv4" destination address="192.168.10.10/32" port port="53" protocol="tcp" accept
rule family="ipv4" destination address="192.168.10.30/32" port port="20" protocol="tcp" accept
rule family="ipv4" destination address="192.168.10.30/32" port port="21" protocol="tcp" accept
rule family="ipv4" destination address="192.168.10.30/32" port port="143" protocol="tcp" accept
rule family="ipv4" destination address="192.168.10.30/32" port port="993" protocol="tcp" accept
rule family="ipv4" destination address="192.168.10.30/32" port port="110" protocol="tcp" accept
rule family="ipv4" destination address="192.168.10.30/32" port port="995" protocol="tcp" accept
rule family="ipv4" destination address="192.168.10.30/32" port port="465" protocol="tcp" accept
Outgoing traffic to External on http port not allowed (You are generating traffic from Enterprise to reach External.) |
[StudentFirst@infa620-nixent01 ~]$ sudo /usr/local/sbin/traffic_test -t 192.168.10.220 -s http [sudo] password for StudentFirst: HPING 192.168.10.220 (daaslab 192.168.10.220): S set, 40 headers + 0 data bytes [send_ip] sendto: Operation not permitted [StudentFirst@infa620-nixent01 ~]$ |
Adding outbound rules |
Via the Terminal |
[StudentFirst@infa620-nixent01 ~]$ sudo firewall-cmd --direct --add-rule ipv4 filter OUTPUT 1 -p tcp -m tcp --dport 80 -j ACCEPT success [StudentFirst@infa620-nixent01 ~]$ |
Outgoing traffic to External on http port allowed |
[StudentFirst@infa620-nixent01 ~]$ sudo /usr/local/sbin/traffic_test -t 192.168.10.220 -s http [sudo] password for StudentFirst: HPING 192.168.10.220 (daaslab 192.168.10.220): S set, 40 headers + 0 data bytes len=44 ip=192.168.10.220 ttl=64 DF id=0 sport=80 flags=SA seq=0 win=29200 rtt=1.9 ms len=44 ip=192.168.10.220 ttl=64 DF id=0 sport=80 flags=SA seq=1 win=29200 rtt=2.0 ms len=44 ip=192.168.10.220 ttl=64 DF id=0 sport=80 flags=SA seq=2 win=29200 rtt=3.8 ms len=44 ip=192.168.10.220 ttl=64 DF id=0 sport=80 flags=SA seq=3 win=29200 rtt=2.0 ms len=44 ip=192.168.10.220 ttl=64 DF id=0 sport=80 flags=SA seq=4 win=29200 rtt=2.0 ms
--- 192.168.10.220 hping statistic --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 1.9/2.3/3.8 ms [StudentFirst@infa620-nixent01 ~]$ |
On your own now, configure rules to allow the following nine services (45 Points):
https to 192.168.10.220
domain and telnet to 192.168.10.210
ftp, imap2, imaps, pop3, pop3s and urd to 192.168.10.230
Before you configure, first make sure using the test script these traffic types are not allowed to the respective hosts. After configuring them, make sure they are allowed to the respective hosts.
Making rules persistent |
[StudentFirst@infa620-nixent01 ~]$ sudo firewall-cmd --runtime-to-permanent success [StudentFirst@infa620-nixent01 ~]$ |
You can view the Iptables to see what rules you have added. In the example below, the table entries that are highlighted are the ones we have just added.
Viewing iptables rules (Just an example output) |
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT udp -- anywhere anywhere multiport dports rfe ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED ACCEPT all -- anywhere anywhere INPUT_direct all -- anywhere anywhere INPUT_ZONES_SOURCE all -- anywhere anywhere INPUT_ZONES all -- anywhere anywhere DROP all -- anywhere anywhere ctstate INVALID REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED ACCEPT all -- anywhere anywhere FORWARD_direct all -- anywhere anywhere FORWARD_IN_ZONES_SOURCE all -- anywhere anywhere FORWARD_IN_ZONES all -- anywhere anywhere FORWARD_OUT_ZONES_SOURCE all -- anywhere anywhere FORWARD_OUT_ZONES all -- anywhere anywhere DROP all -- anywhere anywhere ctstate INVALID REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT) target prot opt source destination OUTPUT_direct all -- anywhere anywhere
Chain FORWARD_IN_ZONES (1 references) target prot opt source destination FWDI_daaslab all -- anywhere anywhere FWDI_trusted all -- anywhere anywhere FWDI_trusted all -- anywhere anywhere
Chain FORWARD_IN_ZONES_SOURCE (1 references) target prot opt source destination
Chain FORWARD_OUT_ZONES (1 references) target prot opt source destination FWDO_daaslab all -- anywhere anywhere FWDO_trusted all -- anywhere anywhere FWDO_trusted all -- anywhere anywhere
Chain FORWARD_OUT_ZONES_SOURCE (1 references) target prot opt source destination
Chain FORWARD_direct (1 references) target prot opt source destination
Chain FWDI_daaslab (1 references) target prot opt source destination FWDI_daaslab_log all -- anywhere anywhere FWDI_daaslab_deny all -- anywhere anywhere FWDI_daaslab_allow all -- anywhere anywhere DROP all -- anywhere anywhere
Chain FWDI_daaslab_allow (1 references) target prot opt source destination
Chain FWDI_daaslab_deny (1 references) target prot opt source destination
Chain FWDI_daaslab_log (1 references) target prot opt source destination
Chain FWDI_trusted (2 references) target prot opt source destination FWDI_trusted_log all -- anywhere anywhere FWDI_trusted_deny all -- anywhere anywhere FWDI_trusted_allow all -- anywhere anywhere ACCEPT all -- anywhere anywhere
Chain FWDI_trusted_allow (1 references) target prot opt source destination
Chain FWDI_trusted_deny (1 references) target prot opt source destination
Chain FWDI_trusted_log (1 references) target prot opt source destination
Chain FWDO_daaslab (1 references) target prot opt source destination FWDO_daaslab_log all -- anywhere anywhere FWDO_daaslab_deny all -- anywhere anywhere FWDO_daaslab_allow all -- anywhere anywhere DROP all -- anywhere anywhere
Chain FWDO_daaslab_allow (1 references) target prot opt source destination
Chain FWDO_daaslab_deny (1 references) target prot opt source destination
Chain FWDO_daaslab_log (1 references) target prot opt source destination
Chain FWDO_trusted (2 references) target prot opt source destination FWDO_trusted_log all -- anywhere anywhere FWDO_trusted_deny all -- anywhere anywhere FWDO_trusted_allow all -- anywhere anywhere ACCEPT all -- anywhere anywhere
Chain FWDO_trusted_allow (1 references) target prot opt source destination
Chain FWDO_trusted_deny (1 references) target prot opt source destination
Chain FWDO_trusted_log (1 references) target prot opt source destination
Chain INPUT_ZONES (1 references) target prot opt source destination IN_daaslab all -- anywhere anywhere IN_trusted all -- anywhere anywhere IN_trusted all -- anywhere anywhere
Chain INPUT_ZONES_SOURCE (1 references) target prot opt source destination
Chain INPUT_direct (1 references) target prot opt source destination
Chain IN_daaslab (1 references) target prot opt source destination IN_daaslab_log all -- anywhere anywhere IN_daaslab_deny all -- anywhere anywhere IN_daaslab_allow all -- anywhere anywhere DROP all -- anywhere anywhere
Chain IN_daaslab_allow (1 references) target prot opt source destination ACCEPT tcp -- anywhere ip-192-168-10-20.ec2.internal tcp dpt:http ctstate NEW ACCEPT tcp -- anywhere ip-192-168-10-20.ec2.internal tcp dpt:https ctstate NEW ACCEPT tcp -- anywhere ip-192-168-10-10.ec2.internal tcp dpt:telnet ctstate NEW ACCEPT tcp -- anywhere ip-192-168-10-10.ec2.internal tcp dpt:domain ctstate NEW ACCEPT tcp -- anywhere ip-192-168-10-30.ec2.internal tcp dpt:ftp-data ctstate NEW ACCEPT tcp -- anywhere ip-192-168-10-30.ec2.internal tcp dpt:ftp ctstate NEW ACCEPT tcp -- anywhere ip-192-168-10-30.ec2.internal tcp dpt:imap ctstate NEW ACCEPT tcp -- anywhere ip-192-168-10-30.ec2.internal tcp dpt:imaps ctstate NEW ACCEPT tcp -- anywhere ip-192-168-10-30.ec2.internal tcp dpt:pop3 ctstate NEW ACCEPT tcp -- anywhere ip-192-168-10-30.ec2.internal tcp dpt:pop3s ctstate NEW ACCEPT tcp -- anywhere ip-192-168-10-30.ec2.internal tcp dpt:urd ctstate NEW
Chain IN_daaslab_deny (1 references) target prot opt source destination
Chain IN_daaslab_log (1 references) target prot opt source destination
Chain IN_trusted (2 references) target prot opt source destination IN_trusted_log all -- anywhere anywhere IN_trusted_deny all -- anywhere anywhere IN_trusted_allow all -- anywhere anywhere ACCEPT all -- anywhere anywhere
Chain IN_trusted_allow (1 references) target prot opt source destination
Chain IN_trusted_deny (1 references) target prot opt source destination
Chain IN_trusted_log (1 references) target prot opt source destination
Chain OUTPUT_direct (1 references) target prot opt source destination ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:http ACCEPT tcp -- anywhere anywhere tcp dpt:https ACCEPT tcp -- anywhere anywhere tcp dpt:telnet ACCEPT tcp -- anywhere anywhere tcp dpt:domain ACCEPT tcp -- anywhere anywhere tcp dpt:ftp-data ACCEPT tcp -- anywhere anywhere tcp dpt:imap ACCEPT tcp -- anywhere anywhere tcp dpt:pop3 ACCEPT tcp -- anywhere anywhere tcp dpt:pop3s ACCEPT tcp -- anywhere anywhere tcp dpt:urd ACCEPT tcp -- anywhere anywhere tcp dpt:ftp ACCEPT tcp -- anywhere anywhere tcp dpt:imaps REJECT all -- anywhere anywhere reject-with icmp-host-prohibited [StudentFirst@infa620-nixent01 ~]$ |
Exporting iptables rules |
[StudentFirst@infa620-nixent01 ~]$ sudo iptables-save > ~/Desktop/iptables_rules-May17-17.txt [sudo] password for StudentFirst: [StudentFirst@infa620-nixent01 ~]$ |
Transfer this file, iptables_rules-May17-17.txt, first to the workspsace Desktop. From there, you can email the file using the Chrome browser to yourself and then submit it to the Lab 4 folder in the classroom.
(10 Points) Also, provide a short summary of your experience of using DaaS for this Lab (Difficulties you have encountered, what worked, what did not work, etc.)
Ask a question
Experts are online
Answers (2)
INFA 620 Laboratory 4: Configuring a Firewall
INFA 620 Laboratory 4: Configuring a Firewall
Answer Attachments
1 attachments —