Open main menu

CDOT Wiki β

Changes

OPS705 Lab 6 (2211)

483 bytes added, 00:50, 7 September 2021
m
Chris.johnson moved page OPS705 Lab 6 to OPS705 Lab 6 (2211) without leaving a redirect
# In the ''Actions'' menu column on the right, click '''Explore'''. This will open a new folder where your IIS web pages are stored.
# Right-click anywhere in that window, click '''New > Text Document'''. Name it '''index.html'''.
# Open the text file, and write the same HTML code as Lab 54, changing the title tag to ''OPS705 IIS Web Server - Fall 2020Winter 2021''.
# Refresh your browser page from ''Part 1''. You should see your new code.
# On your host computer, open a browser and navigate to the URL you used to remotely connect to your Windows Server VM. Unlike the Linux Server in Lab 5, the web page you created does not appear. We still have some work to do.
# Save and quit vim.
# At the command prompt, run: <code>sysctl -p</code>
# Confirm you've properly enabled system-level forwarding with the following command: <code>sysctl net.ipv4.ip_forward</code>
# The response from the command above should say '''net.ipv4.ip_forward = 1'''. If not, revisit the steps in Part 2.
== Part 3: Port Forwarding Using NAT ==
# Remote SSH into your Linux Server VM, and elevate to root.
# Confirm you can access the web server on your Windows VM by running: <code>curl '''IP-address-from-step-1'''</code> If you see plain HTML code displayed, move to the next step.
# We're going to be working with the NAT table. Let's look at the NAT rules listing with the following command: <code>iptables -t nat -nvL --line</code>
# Set up a port forwarding rule so all requests to your Linux VM on port 8080 get sent to your Windows VM on port 80. Run the following: <code>iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination ''windows-server-ip-from-step-1'':80</code>
# Set up NAT for all forwarded traffic: <code>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</code>
# Confirm your new NAT table rules with the command from Step 4.
== Part 4: Adding Forwarding Firewall Rule Exceptions ==
# Create a firewall rule to allow forwarded traffic destined for TCP port 80: <code>iptables -A FORWARD -p tcp --dport 80 -j ACCEPT</code>
# Create a firewall rule to allow forwarded traffic sent from TCP port 80: <code>iptables -A FORWARD -p tcp --sport 80 -j ACCEPT</code>
# Watch your firewall rules and their packet counters with the following command: <code>watch iptables -nvL --line-numbers</code>
# In a browser on your own computer, paste the URL for your Linux VM, adding ''':8080''' to the end of the address, then hit Enter.
# If you've done your work right, the Windows IIS web page should appear!
Submit to Blackboard full-desktop screenshots (PNG/JPG) of the following:
# Browser window showing the Windows IIS page (on your computer, not displayed on your VM).
# SSH session window with your iptables rules listed.(Both normal and NAT rules)
Your professor will review your page directly; the screenshots are a backup in case of catastrophic issues.