Open main menu

CDOT Wiki β

Changes

OPS245 Lab 6

323 bytes added, 9 March
no edit summary
{{Admon/caution|DO NOT USE THIS VERSION OF THE COURSE. This page will no longer be updated.|'''Debian version here:''' https://seneca-ictoer.github.io/OPS245
<br>'''CentOS version here:''' https://seneca-ictoer.github.io/OPS245-C7<br>'''Andrew's version here:''' http://wiki.littlesvr.ca/wiki/OPS245_Lab_6}}
=LAB PREPARATION=
[[Image:my-network.png|thumb|right|350px|Setting up networks is an essential operation for a system administrator. Maintaining network connectivity and securing the network are also essential operations. In this lab, we will '''configure a private virtual network using static IP addresses''' (eg. wired workstation connections). We will learn how to setup a DHCP network (eg. for notebook, table and smartphones) in lab 8.]]
=INVESTIGATION 3: USING PYTHON TO MODIFY FILES=
In this investigation you will write a python script that will allow a user to interactively configure a network interface's configuration file. Before beginning, '''make a backup of your ifcfg files'''. '''Store the python script in ~/bin/''' on c7host.
Write a script called '''netconfig.py''' that will prompt the user for the following values, and write their answers into an ifcfg file stored in the '''/etc/sysconfig/network-scripts''' directory.
# Switch to your '''c7host''' VM.
# Change to your user's '''bin''' directory.
# Issue the Linux command: <b><code><span style="color:#3366CC;font-size:1.2em;">wget https://ictraw.senecacollegegithubusercontent.cacom/~ops245OPS245/labs/main/lab6-check.bash</span></code></b>
# Give the '''lab6-check.bash''' file execute permissions (for the file owner).
# Run the shell script and if there are any warnings, make fixes and re-run shell script until you receive "congratulations" message.