Open main menu

CDOT Wiki β

OPS335 Lab 1 draft

Revision as of 13:53, 10 January 2016 by Andrew (talk | contribs) (Set static IP addresses on vm1, vm2, and vm3)

Basic network configuration

Remember how you set up the network interfaces in your virtual machines in OPS235? You're expected to know that inside out by now. All the services we're configuring in this course require a working network connection so it will be hard for you to get anything done if you don't know how to set a static IP address or change your DNS server or default gateway.

This lab is a crash course of the material from labs 6 and 7 from OPS235

Check current settings

In OPS235 you've used the ifconfig and route commands. In this course we'll use the ip command instead (you're welcome to use the old commands but you're expected to know the new ones too).

  • To get the IP address and subnet mask for all the interfaces:
    • Old: ifconfig
    • New: ip address
  • To get your default gateway:
    • Old: route -n
    • New: ip route
  • To check what DNS server you're using:
    • Old and new: resolv.conf
  • To check your hostname:
    • Old and new: uname -n

Make persistent changes

For the IP address, subnet mask, default gateway, and DNS server you edit a file in /etc/sysconfig/network-scripts/

You'll need a file that describes the settings for a network interface. The association between a specific network interface and the configuration file is made using (from least to most important):

  • The name of the file (ifcfg-interfacename)
  • The "NAME" setting inside the file
  • The "DEVICE" setting inside the file
  • The "HWADDR" setting inside the file

To set the hostname you use the hostnamectl command.

Set static IP addresses on vm1, vm2, and vm3

Except for the host all the machines in this course will have static network configuration. That means you need to be able to perform said configuration and debug problems quickly. If the following steps aren't 100% clear - make sure to practice them.

  1. Edit each of your VMs to use a static IP address. vm1 should use the first available address in the subnet, vm2 the second and vm3 the third.
  2. Don't forget to set the default gateway and DNS server. You can use your host's IP address as a DNS server (libvirt will proxy the requests to the real DNS server).
  3. Make note of the files used and entries required.
  4. Restart each VM and run the following command to ensure they still have the network configuration you set.
  5. Test connectivity by pinging each of your VMs.
  6. Try to ssh from the guest to the host machine, then from the host to the guest.
  7. Try to ping matrix and google from your host machine.
  8. Try to ping matrix and google from each of your VM's to ensure you can reach the outside world.

If everything works - great. If not, move on to the next section.

Network connection troubleshooting

ssh & ssh keys rsync & cron