Networking and Security with Linux

Total Page:16

File Type:pdf, Size:1020Kb

Networking and Security with Linux Networking and Security with Linux by Steven Gordon School of Engineering and Technology CQUniversity Australia This book is available as: HTML: sandilands.info/nsl/ PDF: sandilands.info/nsl/nsl.pdf NSL 19.03 1 March 2019 (r1671) Contents List of Figures xi List of Tables xiii Glossary xv 1 Introduction1 1.1 Purpose of This Book.............................1 1.1.1 History.................................1 1.1.2 Audience................................2 1.1.3 This is NOT a Textbook.......................2 1.2 Using This Book...............................3 1.2.1 Organisation of the Chapters....................3 1.2.2 Following the Examples.......................3 1.2.3 Terminology and Notation......................4 1.2.4 Book Website and Formats......................4 1.2.5 Downloading Example Files.....................4 1.2.6 Other Books and Sources.......................4 1.3 Recognition..................................7 1.3.1 Acknowledgements..........................7 1.3.2 Apologies, Limitations and Reporting Bugs.............7 1.3.3 Licensing...............................8 2 Linux, Ubuntu and VirtualBox9 2.1 What is Ubuntu Linux?...........................9 2.1.1 Why Not Microsoft Windows?....................9 2.2 Installing Ubuntu Linux........................... 10 2.2.1 Ubuntu Variants........................... 10 2.2.2 Installation Approaches....................... 11 2.3 Virtualisation and VirtualBox........................ 12 3 Virtual Networking with Linux and VirtualBox 15 3.1 Virtual Networking and virtnet....................... 15 3.1.1 What is Virtual Networking?.................... 15 3.1.2 Motivation for virtnet........................ 15 3.1.3 How Does virtnet Work?....................... 17 3.1.4 virtnet Terminology.......................... 17 3.1.5 History of virtnet........................... 18 i ii CONTENTS 3.2 Getting Started................................ 19 3.2.1 General Requirements........................ 19 3.2.2 Installation.............................. 20 3.2.3 Creating Your First Topology.................... 21 3.2.4 Creating a Different Topology.................... 23 3.3 Using virtnet................................. 24 3.3.1 Usernames and Passwords...................... 24 3.3.2 Login to Nodes with VirtualBox................... 24 3.3.3 Login to Nodes with Secure Shell.................. 26 3.3.4 Transferring Files........................... 27 3.3.5 Using the Host Web Browser to Access a Guest Web Server... 28 3.3.6 Shutting Down, Saving and Deleting Nodes............ 30 3.4 Troubleshooting virtnet............................ 30 4 Linux Command Line 31 4.1 Prerequisites.................................. 31 4.1.1 Assumed Knowledge......................... 31 4.1.2 Linux and Network Setup...................... 31 4.2 Entering Commands............................. 31 4.2.1 Command Prompt.......................... 31 4.2.2 Commands, Parameters and Options................ 32 4.2.3 Output and Errors.......................... 34 4.2.4 Help with Commands......................... 34 4.3 Directory and File Operations........................ 35 4.4 Viewing and Editing Files.......................... 41 4.4.1 Viewing Text Files.......................... 41 4.4.2 Creating Text Files.......................... 44 4.4.3 Text Editors.............................. 45 4.5 Shortcuts in Bash............................... 46 4.6 Pipes and Redirection............................ 47 4.7 Processes and Jobs.............................. 47 4.8 Searching for Files.............................. 47 4.9 Processing Text Files............................. 47 4.10 More Examples................................ 47 5 The Internet and Applications 51 5.1 The Internet.................................. 51 5.2 Clients, Servers and Addressing....................... 51 5.2.1 Addresses and Ports......................... 51 5.2.2 Servers................................. 52 5.2.3 Clients................................. 53 5.3 Web Browsing................................. 53 5.3.1 HTTP Operation........................... 53 5.3.2 Web Browsing on the Command Line................ 53 5.4 Remote Login................................. 54 CONTENTS iii 6 Automating Tasks with Scripts 57 6.1 Prerequisites.................................. 57 6.1.1 Assumed Knowledge......................... 57 6.1.2 Linux and Network Setup...................... 57 6.2 Introduction to Scripts............................ 57 6.2.1 Shell Scripts are Text Files...................... 58 6.2.2 Variables in Scripts.......................... 59 6.2.3 For Loops............................... 59 6.2.4 If/Then/Else............................. 60 6.2.5 Input Parameters........................... 60 6.2.6 Executing Shell Scripts........................ 61 6.3 More Scripting Examples........................... 62 6.3.1 First Script with echo and ls..................... 63 6.3.2 Using Variables............................ 63 6.3.3 For Loops............................... 64 6.3.4 If/Then/Else............................. 66 6.3.5 Input Arguments........................... 67 6.3.6 Reading a Text File.......................... 68 6.3.7 Extra Commands........................... 69 7 Users and Permissions 73 7.1 Prerequisites.................................. 73 7.1.1 Assumed Knowledge......................... 73 7.1.2 Linux and Network Setup...................... 73 7.2 Users and Permissions in Linux....................... 74 7.2.1 Users.................................. 74 7.2.2 Logins................................. 75 7.2.3 Passwords............................... 75 7.2.4 Permissions.............................. 76 7.3 Commands for Managing Users and Permissions.............. 77 7.4 Users and Permissions by Example..................... 79 7.4.1 Adding Users............................. 80 7.4.2 /etc/passwd and /etc/shadow Files................. 81 7.4.3 Adding Groups............................ 82 7.4.4 Creating Files and Directories.................... 82 7.4.5 Setting Permissions.......................... 83 7.4.6 Summary and Other Issues...................... 88 7.5 Passwords, Hashes and Rainbow Tables................... 89 7.5.1 Storing Actual Passwords...................... 89 7.5.2 Storing Hashed Passwords...................... 90 7.5.3 Brute Force Attacks on Hashed Passwords............. 91 7.5.4 Pre-calculated Hashes and Rainbow Tables............. 92 7.5.5 Salting a Password.......................... 93 7.5.6 Summary and Other Issues...................... 94 iv CONTENTS 8 Cryptography in Linux 95 8.1 Prerequisites.................................. 95 8.1.1 Assumed Knowledge......................... 95 8.1.2 Linux and Network Setup...................... 96 8.2 OpenSSL................................... 96 8.2.1 Overview of OpenSSL........................ 96 8.2.2 Example Scenario........................... 97 8.2.3 Random Numbers........................... 97 8.2.4 Symmetric Key Encryption Basics.................. 99 8.2.5 Hash and MAC Functions...................... 100 8.2.6 Symmetric Key Encryption Padding and Modes of Operation.. 102 8.2.7 RSA and Digital Signatures..................... 105 8.2.8 Diffie-Hellman Secret Key Exchange................ 111 8.2.9 Performance Benchmarking..................... 115 8.3 Using Classical Ciphers with pycipher.................... 116 8.3.1 Install pycipher (Recommended Method).............. 116 8.3.2 Install pycipher (Alternative Method)................ 116 8.3.3 Using pycipher............................ 116 9 Networking Tools 119 9.1 Prerequisites.................................. 119 9.1.1 Assumed Knowledge......................... 119 9.1.2 Linux and Network Setup...................... 120 9.2 Operating Systems and Tool Interfaces................... 120 9.3 Viewing and Changing Network Interface Information........... 120 9.3.1 Viewing Interface Information.................... 121 9.3.2 Changing Interface Information................... 122 9.4 Viewing Ethernet Interface Details..................... 123 9.5 Testing Network Connectivity........................ 125 9.6 Testing a Route................................ 126 9.7 Converting Between Domain Names and IP Addresses........... 127 9.8 Viewing the Routing Table.......................... 129 9.9 Converting IP Addresses to Hardware Addresses.............. 130 9.10 Network Statistics............................... 131 9.11 Useful Networking Files........................... 132 9.11.1 /etc/hostname............................ 132 9.11.2 /etc/hosts............................... 132 9.11.3 /etc/resolv.conf............................ 133 9.11.4 /etc/network/interfaces....................... 133 9.11.5 /etc/services.............................. 134 9.11.6 /etc/protocols............................. 135 9.11.7 /etc/sysctl.conf............................ 135 9.12 Application and Performance Testing.................... 136 9.12.1 Generic Application Testing with netcat.............. 136 9.12.2 Traffic Monitoring with iptraf.................... 138 9.12.3 Internet Performance Measurements with iperf........... 138 9.12.4 Packet Drops and Delays with tc.................. 141 CONTENTS v 10 Routing in Linux 143 10.1 Prerequisites.................................. 143 10.1.1 Assumed Knowledge......................... 143 10.1.2 Linux and Network Setup...................... 144 10.2 Routers.................................... 144 10.2.1 Routers and Hosts.......................... 144 10.2.2 Enabling Routing........................... 145 10.2.3 Editing the Routing Table.....................
Recommended publications
  • At—At, Batch—Execute Commands at a Later Time
    at—at, batch—execute commands at a later time at [–csm] [–f script] [–qqueue] time [date] [+ increment] at –l [ job...] at –r job... batch at and batch read commands from standard input to be executed at a later time. at allows you to specify when the commands should be executed, while jobs queued with batch will execute when system load level permits. Executes commands read from stdin or a file at some later time. Unless redirected, the output is mailed to the user. Example A.1 1 at 6:30am Dec 12 < program 2 at noon tomorrow < program 3 at 1945 pm August 9 < program 4 at now + 3 hours < program 5 at 8:30am Jan 4 < program 6 at -r 83883555320.a EXPLANATION 1. At 6:30 in the morning on December 12th, start the job. 2. At noon tomorrow start the job. 3. At 7:45 in the evening on August 9th, start the job. 4. In three hours start the job. 5. At 8:30 in the morning of January 4th, start the job. 6. Removes previously scheduled job 83883555320.a. awk—pattern scanning and processing language awk [ –fprogram–file ] [ –Fc ] [ prog ] [ parameters ] [ filename...] awk scans each input filename for lines that match any of a set of patterns specified in prog. Example A.2 1 awk '{print $1, $2}' file 2 awk '/John/{print $3, $4}' file 3 awk -F: '{print $3}' /etc/passwd 4 date | awk '{print $6}' EXPLANATION 1. Prints the first two fields of file where fields are separated by whitespace. 2. Prints fields 3 and 4 if the pattern John is found.
    [Show full text]
  • On IP Networking Over Tactical Links
    On IP Networking over Tactical Links Claude Bilodeau The work described in this document was sponsored by the Department of National Defence under Work Unit 5co. Defence R&D Canada √ Ottawa TECHNICAL REPORT DRDC Ottawa TR 2003-099 Communications Research Centre CRC-RP-2003-008 August 2003 On IP networking over tactical links Claude Bilodeau Communications Research Centre The work described in this document was sponsored by the Department of National Defence under Work Unit 5co. Defence R&D Canada - Ottawa Technical Report DRDC Ottawa TR 2003-099 Communications Research Centre CRC RP-2003-008 August 2003 © Her Majesty the Queen as represented by the Minister of National Defence, 2003 © Sa majesté la reine, représentée par le ministre de la Défense nationale, 2003 Abstract This report presents a cross section or potpourri of the numerous issues that surround the tech- nical development of military IP networking over disadvantaged network links. In the first sec- tion, multi-media services are discussed with regard to three aspects: applications, operational characteristics and service models. The second section focuses on subnetworks and bearers; mainly impairments caused by characteristics of the wireless environment. An overview of the Iris tactical bearers is provided as an example of a tactical IP environment. The last section looks at how IP can integrate these two elements i.e. multi-media services and impaired sub- network links. These three sections are unified by a common theme, quality of service, which runs in the background of the discussions. Résumé Ce rapport présente une coupe transversale ou pot-pourri de questions reliées au développe- ment technique des réseaux militaires IP pour des liaisons défavorisées.
    [Show full text]
  • Unix Introduction
    Unix introduction Mikhail Dozmorov Summer 2018 Mikhail Dozmorov Unix introduction Summer 2018 1 / 37 What is Unix Unix is a family of operating systems and environments that exploits the power of linguistic abstractions to perform tasks Unix is not an acronym; it is a pun on “Multics”. Multics was a large multi-user operating system that was being developed at Bell Labs shortly before Unix was created in the early ’70s. Brian Kernighan is credited with the name. All computational genomics is done in Unix http://www.read.seas.harvard.edu/~kohler/class/aosref/ritchie84evolution.pdfMikhail Dozmorov Unix introduction Summer 2018 2 / 37 History of Unix Initial file system, command interpreter (shell), and process management started by Ken Thompson File system and further development from Dennis Ritchie, as well as Doug McIlroy and Joe Ossanna Vast array of simple, dependable tools that each do one simple task Ken Thompson (sitting) and Dennis Ritchie working together at a PDP-11 Mikhail Dozmorov Unix introduction Summer 2018 3 / 37 Philosophy of Unix Vast array of simple, dependable tools Each do one simple task, and do it really well By combining these tools, one can conduct rather sophisticated analyses The Linux help philosophy: “RTFM” (Read the Fine Manual) Mikhail Dozmorov Unix introduction Summer 2018 4 / 37 Know your Unix Unix users spend a lot of time at the command line In Unix, a word is worth a thousand mouse clicks Mikhail Dozmorov Unix introduction Summer 2018 5 / 37 Unix systems Three common types of laptop/desktop operating systems: Windows, Mac, Linux. Mac and Linux are both Unix-like! What that means for us: Unix-like operating systems are equipped with “shells”" that provide a command line user interface.
    [Show full text]
  • A Postgresql Development Environment
    A PostgreSQL development environment Peter Eisentraut [email protected] @petereisentraut The plan tooling building testing developing documenting maintaining Tooling: Git commands Useful commands: git add (-N, -p) git ls-files git am git format-patch git apply git grep (-i, -w, -W) git bisect git log (-S, --grep) git blame -w git merge git branch (--contains, -d, -D, --list, git pull -m, -r) git push (-n, -f, -u) git checkout (file, branch, -b) git rebase git cherry-pick git reset (--hard) git clean (-f, -d, -x, -n) git show git commit (--amend, --reset, -- git status fixup, -a) git stash git diff git tag Tooling: Git configuration [diff] colorMoved = true colorMovedWS = allow-indentation-change [log] date = local [merge] conflictStyle = diff3 [rebase] autosquash = true [stash] showPatch = true [tag] sort = version:refname [versionsort] suffix = "_BETA" suffix = "_RC" Tooling: Git aliases [alias] check-whitespace = \ !git diff-tree --check $(git hash-object -t tree /dev/null) HEAD ${1:-$GIT_PREFIX} find = !git ls-files "*/$1" gtags = !git ls-files | gtags -f - st = status tags = tag -l wdiff = diff --color-words=[[:alnum:]]+ wshow = show --color-words Tooling: Git shell integration zsh vcs_info Tooling: Editor Custom settings for PostgreSQL sources exist. Advanced options: whitespace checking automatic spell checking (flyspell) automatic building (flycheck, flymake) symbol lookup ("tags") Tooling: Shell settings https://superuser.com/questions/521657/zsh-automatically-set-environment-variables-for-a-directory zstyle ':chpwd:profiles:/*/*/devel/postgresql(|/|/*)' profile postgresql chpwd_profile_postgresql() { chpwd_profile_default export EMAIL="[email protected]" alias nano='nano -T4' LESS="$LESS -x4" } Tooling — Summary Your four friends: vcs editor shell terminal Building: How to run configure ./configure -C/--config-cache --prefix=$(cd .
    [Show full text]
  • MLNX OFED Documentation Rev 5.0-2.1.8.0
    MLNX_OFED Documentation Rev 5.0-2.1.8.0 Exported on May/21/2020 06:13 AM https://docs.mellanox.com/x/JLV-AQ Notice This document is provided for information purposes only and shall not be regarded as a warranty of a certain functionality, condition, or quality of a product. NVIDIA Corporation (“NVIDIA”) makes no representations or warranties, expressed or implied, as to the accuracy or completeness of the information contained in this document and assumes no responsibility for any errors contained herein. NVIDIA shall have no liability for the consequences or use of such information or for any infringement of patents or other rights of third parties that may result from its use. This document is not a commitment to develop, release, or deliver any Material (defined below), code, or functionality. NVIDIA reserves the right to make corrections, modifications, enhancements, improvements, and any other changes to this document, at any time without notice. Customer should obtain the latest relevant information before placing orders and should verify that such information is current and complete. NVIDIA products are sold subject to the NVIDIA standard terms and conditions of sale supplied at the time of order acknowledgement, unless otherwise agreed in an individual sales agreement signed by authorized representatives of NVIDIA and customer (“Terms of Sale”). NVIDIA hereby expressly objects to applying any customer general terms and conditions with regards to the purchase of the NVIDIA product referenced in this document. No contractual obligations are formed either directly or indirectly by this document. NVIDIA products are not designed, authorized, or warranted to be suitable for use in medical, military, aircraft, space, or life support equipment, nor in applications where failure or malfunction of the NVIDIA product can reasonably be expected to result in personal injury, death, or property or environmental damage.
    [Show full text]
  • UNIX Cheat Sheet – Sarah Medland Help on Any Unix Command List a Directory Change to Directory Make a New Directory Remove A
    THE 2013 INTERNATIONAL WORKSHOP ON STATISTICAL METHODOLOGY FOR HUMAN GENOMIC STUDIES UNIX cheat sheet – Sarah Medland Help on any Unix command man {command} Type man ls to read the manual for the ls command. which {command} Find out where a program is installed whatis {command} Give short description of command. List a directory ls {path} ls -l {path} Long listing, with date, size and permisions. ls -R {path} Recursive listing, with all subdirs. Change to directory cd {dirname} There must be a space between. cd ~ Go back to home directory, useful if you're lost. cd .. Go back one directory. Make a new directory mkdir {dirname} Remove a directory/file rmdir {dirname} Only works if {dirname} is empty. rm {filespec} ? and * wildcards work like DOS should. "?" is any character; "*" is any string of characters. Print working directory pwd Show where you are as full path. Copy a file or directory cp {file1} {file2} cp -r {dir1} {dir2} Recursive, copy directory and all subdirs. cat {newfile} >> {oldfile} Append newfile to end of oldfile. Move (or rename) a file mv {oldfile} {newfile} Moving a file and renaming it are the same thing. View a text file more {filename} View file one screen at a time. less {filename} Like more , with extra features. cat {filename} View file, but it scrolls. page {filename} Very handy with ncftp . nano {filename} Use text editor. head {filename} show first 10 lines tail {filename} show last 10 lines Compare two files diff {file1} {file2} Show the differences. sdiff {file1} {file2} Show files side by side. Other text commands grep '{pattern}' {file} Find regular expression in file.
    [Show full text]
  • Introduction to Linux – Part 1
    Introduction to Linux – Part 1 Brett Milash and Wim Cardoen Center for High Performance Computing May 22, 2018 ssh Login or Interactive Node kingspeak.chpc.utah.edu Batch queue system … kp001 kp002 …. kpxxx FastX ● https://www.chpc.utah.edu/documentation/software/fastx2.php ● Remote graphical sessions in much more efficient and effective way than simple X forwarding ● Persistence - can be disconnected from without closing the session, allowing users to resume their sessions from other devices. ● Licensed by CHPC ● Desktop clients exist for windows, mac, and linux ● Web based client option ● Server installed on all CHPC interactive nodes and the frisco nodes. Windows – alternatives to FastX ● Need ssh client - PuTTY ● http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html - XShell ● http://www.netsarang.com/download/down_xsh.html ● For X applications also need X-forwarding tool - Xming (use Mesa version as needed for some apps) ● http://www.straightrunning.com/XmingNotes/ - Make sure X forwarding enabled in your ssh client Linux or Mac Desktop ● Just need to open up a terminal or console ● When running applications with graphical interfaces, use ssh –Y or ssh –X Getting Started - Login ● Download and install FastX if you like (required on windows unless you already have PuTTY or Xshell installed) ● If you have a CHPC account: - ssh [email protected] ● If not get a username and password: - ssh [email protected] Shell Basics q A Shell is a program that is the interface between you and the operating system
    [Show full text]
  • CS101 Lecture 9
    How do you copy/move/rename/remove files? How do you create a directory ? What is redirection and piping? Readings: See CCSO’s Unix pages and 9-2 cp option file1 file2 First Version cp file1 file2 file3 … dirname Second Version This is one version of the cp command. file2 is created and the contents of file1 are copied into file2. If file2 already exits, it This version copies the files file1, file2, file3,… into the directory will be replaced with a new one. dirname. where option is -i Protects you from overwriting an existing file by asking you for a yes or no before it copies a file with an existing name. -r Can be used to copy directories and all their contents into a new directory 9-3 9-4 cs101 jsmith cs101 jsmith pwd data data mp1 pwd mp1 {FILES: mp1_data.m, mp1.m } {FILES: mp1_data.m, mp1.m } Copy the file named mp1_data.m from the cs101/data Copy the file named mp1_data.m from the cs101/data directory into the pwd. directory into the mp1 directory. > cp ~cs101/data/mp1_data.m . > cp ~cs101/data/mp1_data.m mp1 The (.) dot means “here”, that is, your pwd. 9-5 The (.) dot means “here”, that is, your pwd. 9-6 Example: To create a new directory named “temp” and to copy mv option file1 file2 First Version the contents of an existing directory named mp1 into temp, This is one version of the mv command. file1 is renamed file2. where option is -i Protects you from overwriting an existing file by asking you > cp -r mp1 temp for a yes or no before it copies a file with an existing name.
    [Show full text]
  • Oracle Database Licensing Information, 11G Release 2 (11.2) E10594-26
    Oracle® Database Licensing Information 11g Release 2 (11.2) E10594-26 July 2012 Oracle Database Licensing Information, 11g Release 2 (11.2) E10594-26 Copyright © 2004, 2012, Oracle and/or its affiliates. All rights reserved. Contributor: Manmeet Ahluwalia, Penny Avril, Charlie Berger, Michelle Bird, Carolyn Bruse, Rich Buchheim, Sandra Cheevers, Leo Cloutier, Bud Endress, Prabhaker Gongloor, Kevin Jernigan, Anil Khilani, Mughees Minhas, Trish McGonigle, Dennis MacNeil, Paul Narth, Anu Natarajan, Paul Needham, Martin Pena, Jill Robinson, Mark Townsend 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.
    [Show full text]
  • Windows Command Prompt Cheatsheet
    Windows Command Prompt Cheatsheet - Command line interface (as opposed to a GUI - graphical user interface) - Used to execute programs - Commands are small programs that do something useful - There are many commands already included with Windows, but we will use a few. - A filepath is where you are in the filesystem • C: is the C drive • C:\user\Documents is the Documents folder • C:\user\Documents\hello.c is a file in the Documents folder Command What it Does Usage dir Displays a list of a folder’s files dir (shows current folder) and subfolders dir myfolder cd Displays the name of the current cd filepath chdir directory or changes the current chdir filepath folder. cd .. (goes one directory up) md Creates a folder (directory) md folder-name mkdir mkdir folder-name rm Deletes a folder (directory) rm folder-name rmdir rmdir folder-name rm /s folder-name rmdir /s folder-name Note: if the folder isn’t empty, you must add the /s. copy Copies a file from one location to copy filepath-from filepath-to another move Moves file from one folder to move folder1\file.txt folder2\ another ren Changes the name of a file ren file1 file2 rename del Deletes one or more files del filename exit Exits batch script or current exit command control echo Used to display a message or to echo message turn off/on messages in batch scripts type Displays contents of a text file type myfile.txt fc Compares two files and displays fc file1 file2 the difference between them cls Clears the screen cls help Provides more details about help (lists all commands) DOS/Command Prompt help command commands Source: https://technet.microsoft.com/en-us/library/cc754340.aspx.
    [Show full text]
  • Lecture 7 Network Management and Debugging
    SYSTEM ADMINISTRATION MTAT.08.021 LECTURE 7 NETWORK MANAGEMENT AND DEBUGGING Prepared By: Amnir Hadachi and Artjom Lind University of Tartu, Institute of Computer Science [email protected] / [email protected] 1 LECTURE 7: NETWORK MGT AND DEBUGGING OUTLINE 1.Intro 2.Network Troubleshooting 3.Ping 4.SmokePing 5.Trace route 6.Network statistics 7.Inspection of live interface activity 8.Packet sniffers 9.Network management protocols 10.Network mapper 2 1. INTRO 3 LECTURE 7: NETWORK MGT AND DEBUGGING INTRO QUOTE: Networks has tendency to increase the number of interdependencies among machine; therefore, they tend to magnify problems. • Network management tasks: ✴ Fault detection for networks, gateways, and critical servers ✴ Schemes for notifying an administrator of problems ✴ General network monitoring, to balance load and plan expansion ✴ Documentation and visualization of the network ✴ Administration of network devices from a central site 4 LECTURE 7: NETWORK MGT AND DEBUGGING INTRO Network Size 160 120 80 40 Management Procedures 0 AUTOMATION ILLUSTRATION OF NETWORK GROWTH VS MGT PROCEDURES AUTOMATION 5 LECTURE 7: NETWORK MGT AND DEBUGGING INTRO • Network: • Subnets + Routers / switches Time to consider • Automating mgt tasks: • shell scripting source: http://www.eventhelix.com/RealtimeMantra/Networking/ip_routing.htm#.VvjkA2MQhIY • network mgt station 6 2. NETWORK TROUBLES HOOTING 7 LECTURE 7: NETWORK MGT AND DEBUGGING NETWORK TROUBLESHOOTING • Many tools are available for debugging • Debugging: • Low-level (e.g. TCP/IP layer) • high-level (e.g. DNS, NFS, and HTTP) • This section progress: ping trace route GENERAL ESSENTIAL TROUBLESHOOTING netstat TOOLS STRATEGY nmap tcpdump … 8 LECTURE 7: NETWORK MGT AND DEBUGGING NETWORK TROUBLESHOOTING • Before action, principle to consider: ✴ Make one change at a time ✴ Document the situation as it was before you got involved.
    [Show full text]
  • Common Commands Cheat Sheet by Mmorykan Via Cheatography.Com/89673/Cs/20411
    Common Commands Cheat Sheet by mmorykan via cheatography.com/89673/cs/20411/ Scripting Scripting (cont) GitHub bash filename - Runs script sleep value - Forces the script to wait value git clone <url​ > - Clones gitkeeper url Shebang - "#​ !bi​ n/b​ ash​ " - First line of bash seconds git add <fil​ ena​ me>​ - Adds the file to git script. Tells script what binary to use while [[ condition ]]; do stuff; done git commit - Commits all files to git ./file​ name - Also runs script if [[ condition ]]; do stuff; fi git push - Pushes all git files to host # - Creates a comment until [[ condition ]]; do stuff; done echo ${varia​ ble} - Prints variable words="​ h​ ouse dogs telephone dog" - Package / Networking hello_int = 1 - Treats "1​ " as a string Declares words array dnf upgrade - Updates system packages Use UPPERC​ ASE for constant variables for word in ${words} - traverses each dnf install - Installs package element in array Use lowerc​ ase​ _wi​ th_​ und​ ers​ cores for dnf search - Searches for package for counter in {1..10} - Loops 10 times regular variables dnf remove - Removes package for ((;;)) - Is infinite for loop echo $(( ${hello​ _int} + 1 )) - Treats hello_int systemctl start - Starts systemd service as an integer and prints 2 break - exits loop body systemctl stop - Stops systemd service mktemp - Creates temporary random file for ((count​ er=1; counter -le 10; counter​ ++)) systemctl restart - Restarts systemd service test - Denoted by "[[ condition ]]" tests the - Loops 10 times systemctl reload - Reloads systemd service condition
    [Show full text]