Changes

Jump to: navigation, search

OPS235 Lab 6 - Fedora17

28 bytes removed, 10:47, 5 March 2010
Investigation 8: How do I view and configure the IPTABLES firewall? -- Basic Function/Configuration
** <code>iptables -I OUTPUT -p tcp -s0/0 -d 0/0 –dport 80 -j DROP</code>
{{Admon/note | | This command can be read like this: , Insert a line into the iptables OUTPUT chain that will look at tcp information and DROP any packet with a source address from anywhere, to a destination address to anywhere if the destination port = is 80 (WWW.) Let's break down the command to see how it works.
The '''-I''' switch tells iptables to INSERT this line into the OUTPUT policy. This means it will be the first line in the policy. If we used a -A switch it would have appended the line and it would be the last line of the policy. If you are writing complex iptables rules where multiple matches can occur, it is important that the lines go in the right order. Most people simply write scripts to ensure this.
}}
* Try to access the Web. If you have done everything right, you should not have been successful.
* After you have completed the test execute the following command:
** <code>iptables -F</code>
'''Additional Exercises'''
  Try to access the Web. If you have done everything right, you should not have been successful. 12. After you have completed the test execute the following command: '''iptables -F''' Additional Exercises This will flush out all of the rules for iptables. * Using the information you havelearned, try on your own to achieve the same goal as above (block www access to your computer) by using the INPUT chain instead of the OUTPUT chain. * After you have completed this task, flush the iptables again. * Make sure that your ssh server is running on the host machine and try to access it from a virtual machine of your choice. Once you have confirmed that ssh is running on the host machine, modify the iptables setup on the host machine to prevent access to the ssh server from all VM's on the virtual machinenetwork.
Open a text editor and write a script that will accomplish the above task for you when you run it. Show the script to your professor and execute it.
9
edits

Navigation menu