Open main menu

CDOT Wiki β

Changes

OPS335 Lab 1

7 bytes added, 12:18, 14 January 2016
no edit summary
In OPS235, you learned how to configure a virtual private network via graphical applications for the '''centos1''' and '''centos2''' machines. In the previous lab, you have created and cloned VMs that are text-based only ('''like centos3'''). All of the virtual machines will be text-based (just like centos3 in OPS235) for this course. All of the services that we are configuring in this course require a working network connection; therefore, it is very important that you know how to set (preferable configure) a static IP address, default gateway, as well as your DNS serverfrom the command line.
This lab is a <u>review</u> of the material from labs 6 ( [http://zenit.senecac.on.ca/wiki/index.php/OPS235_Lab_6_-_CentOS7#Part_4:_Configuring_VM_Network_Setup_via_Command_Line_.28centos3.29 CLI Network Configuration] ), but will also show newer (more efficient) commands in the process.
== Checking Your Current Network Settings ==
In OPS235 you've have 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 tooas well).
'''Perform the following steps:'''
# View the table below comparing ''older '' vs ''newer '' methods of obtaining network setting information for a Linux machine.
<tr> <td>Obtain DNS Server</td><th>nslookup</th><th>more resolv.conf</th></tr>
<tr> <td>Obtain Hostname</td><th>uname -n</th><th>Sameuname -n</th></tr>
</table>
<ol><li value="2">Run the '''ifconfig''' and '''ip address''' commands separately. Do you notice any differences between their respective outputs?</li><li>Repeat the same steps for the other two sets set of ''older'' vs ''newer'' commands listed in the table.</li><li>Which commands do you prefer to use?</li><li>Use the man pages to see how to issue the above commands to create a <u>temporary</u> connection to your existing network.</ol>
# From your ''OPS335''/''OPS235''/''ULI101'' notes, issue a command to provide the full path-name of the directory: ''network-scripts''
# Why do you think that previously issued command can be useful when you want to edit your exiting network settings?# The name of the file that contains your persistent network settings has the following name format: <br>'''ifcfg-''interfacename'''''
# Which filename in your network-scripts directory do you think contains your current network settings?
# View the contents of the file to see if it contains the IP ADDRESS, subnet mask, and default gateway?.
# What is the MAC address if your current machine?
# Does this file contain the hostname of your machine? If not, what command can allow you to change your machine's hostname?
 
== Set static IP addresses on vm1, vm2, and vm3 ==
Except for your host machine, all the Virtual Machines in this course will have '''static network configuration''' (as opposed to Automatic or DHCP).
Perform <ol><li value="7">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.</li><li>Don't forget to set the default gateway and DNS server for your VMs. You can use your host's IP address as a DNS server (libvirt will proxy the requests to the real DNS server).</li><li>Make note of the files used and entries required and note them in your lab log-book.</li><li>Restart each VM and run the following Stepscommand to ensure they still have the network configuration you set:</li></ol>
# 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.
# Don't forget to set the default gateway and DNS server for your VMs. You can use your host's IP address as a DNS server (libvirt will proxy the requests to the real DNS server).
# Make note of the files used and entries required and note them in your lab log-book.
# Restart each VM and run the following command to ensure they still have the network configuration you set:
::'''ping''' (what is the purpose of this command?). Try to ping matrix and google from your host machine. Try to ping matrix and google from each of your VM's to ensure you can reach the outside world.
::'''ssh''' (into another server, like Matrix)
13,420
edits