OPS245 Lab 6: Difference between revisions

From Littlesvr Wiki
Jump to navigation Jump to search
Line 39: Line 39:


[[File:DebianModifyInterfaces.png|800px|border|center]]
[[File:DebianModifyInterfaces.png|800px|border|center]]
[[File:DebianModifyResolvConf.png|800px|border|center]]


[[File:DebianRestartenp0s3.png|800px|border|center]]
[[File:DebianRestartenp0s3.png|800px|border|center]]

Revision as of 12:24, 12 March 2023

!!!THIS LAB IS NOT READY YET!!!

The default networking setup in VirtualBox works fine for accessing the internet from guests, but it's not very good for communicating between the guests and the host.

In this lab we'll set up a new virtual network, and a very basic name resolution mechanism.

Basic concepts

Your machine needs these four things configured correctly in order to be able to connect to the internet. Nearly all networking problems you'll run into in this course are due to one of these things being misconfigured:

  1. IP address. This address is used to connect to anything else on the local network. You'll be using an address on a private subnet, which means that your IP address cannot be used outside your subnet. All communication protocols on the internet work over IP.
  2. Subnet Mask. No matter which notation you use: the subnet mask does the same thing. It specifies and implies some important technical details about the network you're connected to. Any machines in the same subnet can communicate directly with each other using broadcasts.
  3. Default gateway. As soon as you want to connect to anything outside your own subnet: you need to go through a gateway. In this course you'll only have one gateway. The gateway is a router which must be inside your subnet.
  4. DNS server. Provides a service which translates domain names into IP addresses. Though all communication on the internet is done with IP addresses: people are very bad at remembering numbers, so everything is built with the assumption that DNS works.

New network: ops245net

  • Use a terminal in your host machine to run this command:
    VBoxManage natnetwork add --netname ops245net --network "10.2.45.0/24" --dhcp off --enable
    
    If your host is Linux: run that as a regular user, not as root.
  • Run VBoxManage natnetwork list to check that it worked.
  • For each of your 4 virtual machines: change their network settings for Adapter 1 from NAT to NAT Network (ops245net).
NatNetwork.png
  • On your workstation open the graphical Network Connections tool via the network icon in the system tray.
  • You can read more about the various virtual network types available in VirtualBox in the VirtualBox manual.

Graphical network configuration

  • Modify the IPv4 settings for the existing wired connection from DHCP to Manual, with the following settings:
    • IP address 10.2.45.10
    • Netmask 255.255.255.0
    • Gateway 10.2.45.1
    • DNS server 10.2.45.1
WorkstationWiredConnection.png
  • Confirm that all the settings were set correctly and that your internet connection works again:
Workstation-ops245net.png

Command-line network configuration

DebianModifyInterfaces.png
DebianModifyResolvConf.png
DebianRestartenp0s3.png