LAB DHCP - LINUX Execute the Following Procedure on the VM

Total Page:16

File Type:pdf, Size:1020Kb

LAB DHCP - LINUX Execute the Following Procedure on the VM LAB DHCP - LINUX Execute the following procedure on the VM : ifconfig eth0 20.0.13.14 mkdir dhcp 1. SCENARIO 1 scp [email protected]:dhcp/* dhcp Remember that if you are using the remote server espec, the login is the same as you used to connect via SSH or VNC. If you are using the VMware image, the login and password are rss and pucpos, respectively . 3. DHCP SERVER CONFIGURATION In this first scenario, you must create three virtual machines, as shown in Fig. The G1 VM acts as a router and a DHCP server (which is a common practice in many systems). 2. VMS IN SCENARIO 1 The figure illustrates the IP addresses assignment for Download the package with the required files in your home scenario 1. The 13.14.0.0/24 and 13.14.1.0/24 subnets directory: assumes your student code is ( 101 ) 11.12.13.14 - x . You must replace the prefix 13:14 to match your actual student wget espec.ppgia.pucpr.br/jam_pacotes/dhcp.tar.gz code. tar -xzf dhcp.tar.gz The following procedure should be performed on the VM Take care to not cause conflicts with the addresses of other G1. A dhcpd.conf file in the dhcp directory is created when VMs running on the espec server. For this, assuming your you unzip dhcp.tar.gz package. Edit this file using vi, student code is (101) 11 12 13 14 -x , choose the following changing addresses in accordance with your student code. addresses: After making these changes, copy the dhcpd.conf file to the G : 20.0.13.14 /etc directory: H1: 20.1.13.14 H2 : 20.2.13.14 cd /root/dhcp cp dhcpd.conf /etc/dhcp First, open a terminal in the espec, and create a directory to store the virtual machines: Create VLANs and assign IP addresses to the router interfaces. mkdir dhcplab cd dhcplab vconfig add eth0 2 ifconfig eth0.2 13.14.0.1/24 Create the first virtual machine to represent the gateway vconfig add eth0 3 G1: ifconfig eth0.3 13.14.1.1/24 sysctl -w net.ipv4.ip_forward=1 linux32.redes G1 login: root Run the dhcpd server with the following command: dhcpd If you receive an error message, you must correct the /etc/dhcpd.conf and restart the dhcpd server. You need to restart the dchpd server if you make any changes in the dhcpd.conf file. service dhcpd restart The message about eth0 is not an error and can be ignored (it simply reports that there is no subnet for interface eth0). 4. HOST CONFIGURATION You don´t need a dhclient installed on a host to use DHCP. Each host interface can be configured automatically when booting the operating system using a startup script ifcfg- ethX in /etc/sysconfig/network-scripts directory. To H2 host, we will use this strategy. If you have not done so, create a virtual machine to represent the host H2: linux32.redes H2 Execute the following procedure on the VM: login: root ifconfig eth0 20.2.13.14 If you have not done so, create a virtual machine to represent the host H1: Create a VLAN interface on H2: linux32.redes H1 vconfig add eth0 3 Execute the following procedure on the VM: Create a configuration file for eth0.3: login: root cd /etc/sysconfig/network-scripts ifconfig eth0 20.1.13.14 vi ifcfg-eth0.3 Create a VLAN interface on H1: Edit the ifcfg-eth0.3 with the following content: vconfig add eth0 2 DEVICE=eth0.3 BOOTPROTO=dhcp Execute dhclient and check the IP address: ONBOOT=yes TYPE=Ethernet dhclient eth0.2 ifconfig Create and edit the ifcfg-eth0 file as follows (there is no DHCP for eth0): To release an IP address, type: vi ifcfg-eth0 dhclient eth0.2 -r DEVICE=eth0 BOOTPROTO=static IPADDR=20.2.13.14 NETMASK=255.0.0.0 ifconfig eth0.3 13.14.1.2/24 ONBOOT=yes vconfig add eth0 4 ifconfig eth0.4 13.14.2.1/24 The next step is usually not necessary in non-virtualized sysctl -w net.ipv4.ip_forward=1 Linux environment. The image was created without an physical interface, and then some network configuration Activate the relay agent to redirect the incoming DHCP files were missing in installation. Create the /etc/sysconfig/ messages to G1: network in the UML machine: dhcrelay 13.14.1.1 vi /etc/sysconfig/network Additional commands on G1 VM: The file needs to include the following line: Include in G1 a route to the subnet VM4: NETWORKING=yes route add -net 13.14.2.0/24 gw 13.14.1.2 Restart the network service and check the IP addresses: Additional commands on Host 2 VM: service network restart ifconfig Move host 2 to VLAN 4 to obtain a new IP address: vconfig rem eth0.3 vconfig add eth0 4 dhclient -r (kill the previous dhcp client instance) 5. SCENARIO 2 dhclient eth0.4 6. REPORT TO DELIVER THROUGH EUREKA In this report you must include the information of two files used by the DHCP server ( i.e., the VM G1 ) : The configuration file: /etc/dhcpd.conf The leases file: /var/lib/dhcpd/dhcpd.leases Transfer both files to your directory in the espec and create a text file or .pdf file with this information. scp /etc/dhcpd.conf [email protected]:. Scenario 2 evaluates the concept of relay agent as indicated scp /var/lib/dhcpd/dhcpd.leases [email protected]:. in the figure. Create the virtual machine G2 to represent the relay agent: ALTERNATE METHOD TO TRANSFER FILES TO THE HOST ENVIRONMENT linux32.redes G2 There is an alternative method that can be used to transfer Execute the following commands on the new VM: files from the UML virtual machine to the HOST environment (espec) . login: root ifconfig eth0 20.3.13.14 Enter the following command in the HOST machine: Create a VLAN interface on G2 mkdir /espec mount none /espec -t hostfs -o /home/rss vconfig add eth0 3 The directory /espec in the UML is now mounted and represents a directory in the espec. You can transfer the files using cp . For example: cp vlan.cap /espec The file will appear in the default directory (/home/rss ) in the host environment. This mapping can also be done on espec server environment. In this case, however , you'd better first check your default directory in espec. Enter the following command in a terminal: pwd Replace the path after the " -o " parameter , as follows : mkdir /espec mount none /espec -t hostfs -o pwd_path .
Recommended publications
  • Working with DHCP in Oracle® Solaris 11.2
    ® Working With DHCP in Oracle Solaris 11.2 Part No: E36812 July 2014 Copyright © 1999, 2014, Oracle and/or its affiliates. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT END USERS. Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government. This software or hardware is developed for general use in a variety of information management applications.
    [Show full text]
  • Powerview Command Reference
    PowerView Command Reference TRACE32 Online Help TRACE32 Directory TRACE32 Index TRACE32 Documents ...................................................................................................................... PowerView User Interface ............................................................................................................ PowerView Command Reference .............................................................................................1 History ...................................................................................................................................... 12 ABORT ...................................................................................................................................... 13 ABORT Abort driver program 13 AREA ........................................................................................................................................ 14 AREA Message windows 14 AREA.CLEAR Clear area 15 AREA.CLOSE Close output file 15 AREA.Create Create or modify message area 16 AREA.Delete Delete message area 17 AREA.List Display a detailed list off all message areas 18 AREA.OPEN Open output file 20 AREA.PIPE Redirect area to stdout 21 AREA.RESet Reset areas 21 AREA.SAVE Save AREA window contents to file 21 AREA.Select Select area 22 AREA.STDERR Redirect area to stderr 23 AREA.STDOUT Redirect area to stdout 23 AREA.view Display message area in AREA window 24 AutoSTOre ..............................................................................................................................
    [Show full text]
  • Pf3e Index.Pdf
    INDEX Note: Pages numbers followed by f, n, priority-based queues, 136–145 or t indicate figures, notes, and tables, match rule for queue assignment, respectively. 137–138 overview, 134–135 Symbols performance improvement, 136–137 # (hash mark), 13, 15 queuing for servers in DMZ, ! (logical NOT) operator, 42 142–144 setting up, 135–136 A on FreeBSD, 135–136 on NetBSD, 136 Acar, Can Erkin, 173 on OpenBSD, 135 ACK (acknowledgment) packets transitioning to priority and class-based bandwidth allocation, queuing system, 131–133 139–140 anchors, 35–36 HFSC algorithm, 124, 126, 142 authpf program, 61, 63 priority queues, 132, 137–138 listing current contents of, 92 two-priority configuration, loading rules into, 92 120–121, 120n1 manipulating contents, 92 adaptive.end value, 188 relayd daemon, 74 adaptive firewalls, 97–99 restructuring rule set with, 91–94 adaptive.start value, 188 tagging to help policy routing, 93 advbase parameter, 153–154 ancontrol command, 46n1 advskew parameter, 153–154, 158–159 antispoof tool, 27, 193–195, 194f aggressive value, 192 ARP balancing, 151, 157–158 ALTQ (alternate queuing) framework, atomic rule set load, 21 9, 133–145, 133n2 authpf program, 59–63, 60 basic concepts, 134 basic authenticating gateways, class-based bandwidth allocation, 60–62 139–140 public networks, 62–63 overview, 135 queue definition, 139–140 tying queues into rule set, 140 B handling unwanted traffic, 144–145 bandwidth operating system-based queue actual available, 142–143 assignments, 145 class-based allocation of, 139–140 overloading to
    [Show full text]
  • Install and Setup DHCP Service
    Install and setup DHCP Service Synopsis: DHCP or Dynamic Host Configuration Protocol allows for automatic management of IP addresses on your internal network. By providing DHCP on your LAN, you eliminate the bother of having to configure manually PCs, laptops, or smart phones. They will automatically get an IP address and be configured with default gateway and DNS server information. It is important that only one DHCP server be active on a network. So, check carefully any other network devices on your network, especially wireless Access Points, to be sure their DHCP service is disabled. I. Installation Log into the Freebsd system as root. (Assumes networking is already configured.) # # cd /usr/ports/net/isc-dhcp44-server && make install clean # II. Startup Configuration Enable DHCP daemon at startup and assign the internal LAN (sk0 in this project) interface; # # echo 'dhcpd_enable="YES"' >> /etc/rc.conf # echo 'dhcpd_ifaces="sk0"' >> /etc/rc.conf # III. Setup configuration file # # cd /usr/local/etc # If there is a dhcpd.conf file, rename it; # # mv dhcpd.conf dhcpd.conf.original # Copy the following text, modify for your personal use, and paste it into a new dhcpd.conf file. You will need to modify the subnet (i.e., your network zero) and mask, the IP pool range, the DNS server (in this case 8.8.8.8 is the Google DNS server), the domain name, the router/gateway and the broadcast address (i.e., your network 255). The settings shown assumes our LAN subnet will be the private range 192.168.1.0 to 192.168.1.255. This machine will have LAN address configured as 192.168.1.254 and will be the default gateway for the LAN network.
    [Show full text]
  • The Complete Freebsd
    The Complete FreeBSD® If you find errors in this book, please report them to Greg Lehey <grog@Free- BSD.org> for inclusion in the errata list. The Complete FreeBSD® Fourth Edition Tenth anniversary version, 24 February 2006 Greg Lehey The Complete FreeBSD® by Greg Lehey <[email protected]> Copyright © 1996, 1997, 1999, 2002, 2003, 2006 by Greg Lehey. This book is licensed under the Creative Commons “Attribution-NonCommercial-ShareAlike 2.5” license. The full text is located at http://creativecommons.org/licenses/by-nc-sa/2.5/legalcode. You are free: • to copy, distribute, display, and perform the work • to make derivative works under the following conditions: • Attribution. You must attribute the work in the manner specified by the author or licensor. • Noncommercial. You may not use this work for commercial purposes. This clause is modified from the original by the provision: You may use this book for commercial purposes if you pay me the sum of USD 20 per copy printed (whether sold or not). You must also agree to allow inspection of printing records and other material necessary to confirm the royalty sums. The purpose of this clause is to make it attractive to negotiate sensible royalties before printing. • Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. • For any reuse or distribution, you must make clear to others the license terms of this work. • Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above.
    [Show full text]
  • Lab Intro to Console Commands
    New Lab Intro to KDE Terminal Konsole After completing this lab activity the student will be able to; Access the KDE Terminal Konsole and enter basic commands. Enter commands using a typical command line interface (CLI). Explain the use of the following commands, ls, ls –al, dir, mkdir, whoami, Explain the directory structure of a typical user. This lab activity will introduce you to one of the many command line interfaces available in Linux/UNIX operating systems and a few of the most basic commands. The command line interface you will be using for this lab activity is the console called the Konsole and is also referred to as Terminal. Note: As you notice, in the KDE system many features are written with the capital letter “K” in place of the first letter or the utility to reflect the fact it was modified for the KDE system. The original UNIX system did not use a graphical user interface GUI but rather was a command line interface (CLI) similar to the command prompt in Windows operating systems. The command line interface is referred to as a shell. Even today the command line interface (the shell) is used to issue commands on a Linux server to minimize system resources. For example, there is no need to start the GUI on the server to add a new user to an existing system. Starting the GUI will reduce the system performance because it requires RAM to run the GUI. A GUI will affect the overall performance of the server when it is supporting many users (clients).
    [Show full text]
  • Utilising Configuration Management Node Data for Network Infrastructure
    Aalto University School of Science Degree Programme in Computer Science and Engineering Lauri Tirkkonen Utilising configuration management node data for network infrastructure man- agement Master's Thesis Espoo, May 4, 2016 Supervisor: Professor Heikki Saikkonen Advisor: Jaakko Kotim¨akiM.Sc. (Tech.) Aalto University School of Science ABSTRACT OF Degree Programme in Computer Science and Engineering MASTER'S THESIS Author: Lauri Tirkkonen Title: Utilising configuration management node data for network infrastructure man- agement Date: May 4, 2016 Pages: 38 Major: Software Technology Code: T-106 Supervisor: Professor Heikki Saikkonen Advisor: Jaakko Kotim¨akiM.Sc. (Tech.) Configuration management software running on nodes solves problems such as configuration drift on the nodes themselves, but the necessary node configura- tion data can also be utilised in managing network infrastructure, for example to reduce configuration errors by facilitating node life cycle management. Many configuration management software systems depend on a working network, but we can utilise the data to create large parts of the network infrastructure config- uration itself using node data from the configuration management system before the nodes themselves are provisioned, as well as remove obsolete configuration as nodes are decommissioned. Keywords: configuration management, network infrastructure configura- tion, life cycle management Language: English 2 Aalto-yliopisto Perustieteiden korkeakoulu DIPLOMITYON¨ Tietotekniikan koulutusohjelma TIIVISTELMA¨ Tekij¨a: Lauri Tirkkonen
    [Show full text]
  • Ubuntu Server Guide Basic Installation Preparing to Install
    Ubuntu Server Guide Welcome to the Ubuntu Server Guide! This site includes information on using Ubuntu Server for the latest LTS release, Ubuntu 20.04 LTS (Focal Fossa). For an offline version as well as versions for previous releases see below. Improving the Documentation If you find any errors or have suggestions for improvements to pages, please use the link at thebottomof each topic titled: “Help improve this document in the forum.” This link will take you to the Server Discourse forum for the specific page you are viewing. There you can share your comments or let us know aboutbugs with any page. PDFs and Previous Releases Below are links to the previous Ubuntu Server release server guides as well as an offline copy of the current version of this site: Ubuntu 20.04 LTS (Focal Fossa): PDF Ubuntu 18.04 LTS (Bionic Beaver): Web and PDF Ubuntu 16.04 LTS (Xenial Xerus): Web and PDF Support There are a couple of different ways that the Ubuntu Server edition is supported: commercial support and community support. The main commercial support (and development funding) is available from Canonical, Ltd. They supply reasonably- priced support contracts on a per desktop or per-server basis. For more information see the Ubuntu Advantage page. Community support is also provided by dedicated individuals and companies that wish to make Ubuntu the best distribution possible. Support is provided through multiple mailing lists, IRC channels, forums, blogs, wikis, etc. The large amount of information available can be overwhelming, but a good search engine query can usually provide an answer to your questions.
    [Show full text]
  • UEFI Shell Specification
    UEFI Shell Specification January 26, 2016 Revision 2.2 The material contained herein is not a license, either expressly or impliedly, to any intellectual property owned or controlled by any of the authors or developers of this material or to any contribution thereto. The material contained herein is provided on an "AS IS" basis and, to the maximum extent permitted by applicable law, this information is provided AS IS AND WITH ALL FAULTS, and the authors and developers of this material hereby disclaim all other warranties and conditions, either express, implied or statutory, including, but not limited to, any (if any) implied warranties, duties or conditions of merchantability, of fitness for a particular purpose, of accuracy or completeness of responses, of results, of workmanlike effort, of lack of viruses and of lack of negligence, all with regard to this material and any contribution thereto. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." The Unified EFI Forum, Inc. reserves any features or instructions so marked for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. ALSO, THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR NON-INFRINGEMENT WITH REGARD TO THE SPECIFICATION AND ANY CONTRIBUTION THERETO. IN NO EVENT WILL ANY AUTHOR OR DEVELOPER OF THIS MATERIAL OR ANY CONTRIBUTION THERETO BE LIABLE TO ANY OTHER PARTY FOR THE COST OF PROCURING SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY OTHER AGREEMENT RELATING TO THIS DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
    [Show full text]
  • Linux Networking 101
    The Gorilla ® Guide to… Linux Networking 101 Inside this Guide: • Discover how Linux continues its march toward world domination • Learn basic Linux administration tips • See how easy it can be to build your entire network on a Linux foundation • Find out how Cumulus Linux is your ticket to networking freedom David M. Davis ActualTech Media Helping You Navigate The Technology Jungle! In Partnership With www.actualtechmedia.com The Gorilla Guide To… Linux Networking 101 Author David M. Davis, ActualTech Media Editors Hilary Kirchner, Dream Write Creative, LLC Christina Guthrie, Guthrie Writing & Editorial, LLC Madison Emery, Cumulus Networks Layout and Design Scott D. Lowe, ActualTech Media Copyright © 2017 by ActualTech Media. All rights reserved. No portion of this book may be reproduced or used in any manner without the express written permission of the publisher except for the use of brief quotations. The information provided within this eBook is for general informational purposes only. While we try to keep the information up- to-date and correct, there are no representations or warranties, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the information, products, services, or related graphics contained in this book for any purpose. Any use of this information is at your own risk. ActualTech Media Okatie Village Ste 103-157 Bluffton, SC 29909 www.actualtechmedia.com Entering the Jungle Introduction: Six Reasons You Need to Learn Linux ....................................................... 7 1. Linux is the future ........................................................................ 9 2. Linux is on everything .................................................................. 9 3. Linux is adaptable ....................................................................... 10 4. Linux has a strong community and ecosystem ........................... 10 5.
    [Show full text]
  • How to Change the ADNP/9200 Factory-Set IP Address for LAN2
    DIL/NetPC ADNP/9200 – microHOWTO How to change the ADNP/9200 Factory-Set IP Address for LAN2 The IP address for the ADNP/9200 LAN2 Ethernet interface is based on a U-Boot environment variable. The factory-set value for this default IP address is 192.168.1.126. Please see also: mHTA9200-05.pdf: How to change the U-Boot IP Addresses for the LAN1 Ethernet Interface and mHTA9200-04.pdf: How to change the ADNP/9200 Factory-Set IP Address for LAN1 (ipaddree usage). • 1. Step: Set the ADNP/9200 RCM jumper for RCM enable. Then power-up your ADNP/9200 and interrupt the U-Boot auto boot process. Change to the U-Boot command line interface. Then enter the U-Boot command printenv. U-Boot> printenv bootargs=console=ttyS0,115200 root=/dev/ram bootdelay=3 baudrate=115200 ethaddr=02:80:ad:20:57:23 ethaddr2=02:80:ad:20:57:24 bootfile="img-dnp9200" netmask=255.255.255.0 ipaddr=192.168.0.126 ipaddr2=192.168.1.126 bootcmd=bootm 0x10040000 serverip=192.168.0.1 stdin=serial stdout=serial stderr=serial Environment size: 300/4092 bytes U-Boot> • 2. Step: The U-Boot command setenv <name> allows you to change the value for an environ- ment variable. The command saveenv stores the new value in the ADNP/9200 flash memory. U-Boot> setenv ipaddr2 192.168.3.126 U-Boot> saveenv Saving Environment to Flash... Un-Protected 1 sectors Erasing Flash... done Erased 1 sectors Writing to Flash... done Protected 1 sectors U-Boot> • 3.
    [Show full text]
  • Free, Functional, and Secure
    Free, Functional, and Secure Dante Catalfamo What is OpenBSD? Not Linux? ● Unix-like ● Similar layout ● Similar tools ● POSIX ● NOT the same History ● Originated at AT&T, who were unable to compete in the industry (1970s) ● Given to Universities for educational purposes ● Universities improved the code under the BSD license The License The license: ● Retain the copyright notice ● No warranty ● Don’t use the author's name to promote the product History Cont’d ● After 15 years, the partnership ended ● Almost the entire OS had been rewritten ● The university released the (now mostly BSD licensed) code for free History Cont’d ● AT&T launching Unix System Labories (USL) ● Sued UC Berkeley ● Berkeley fought back, claiming the code didn’t belong to AT&T ● 2 year lawsuit ● AT&T lost, and was found guilty of violating the BSD license History Cont’d ● BSD4.4-Lite released ● The only operating system ever released incomplete ● This became the base of FreeBSD and NetBSD, and eventually OpenBSD and MacOS History Cont’d ● Theo DeRaadt ○ Originally a NetBSD developer ○ Forked NetBSD into OpenBSD after disagreement the direction of the project *fork* Innovations W^X ● Pioneered by the OpenBSD project in 3.3 in 2002, strictly enforced in 6.0 ● Memory can either be write or execute, but but both (XOR) ● Similar to PaX Linux kernel extension (developed later) AnonCVS ● First project with a public source tree featuring version control (1995) ● Now an extremely popular model of software development anonymous anonymous anonymous anonymous anonymous IPSec ● First free operating system to implement an IPSec VPN stack Privilege Separation ● First implemented in 3.2 ● Split a program into processes performing different sub-functions ● Now used in almost all privileged programs in OpenBSD like httpd, bgpd, dhcpd, syslog, sndio, etc.
    [Show full text]