IT 1100 : Introduction to Operating Systems

Chapter 14

Network Settings

Every machine must have a unique IP on the network. The IP identifies all computers.

DHCP - Dynamic Host Configuration Protocol

  • Many networks and computers are set up to dynamically assign an IP to a computer when it connects to the network. The controller ensures that all IP's are unique. Thus it is possible that the IP of the computer could change every time it is turned on. This method requires less work.

Static IP - Static IP Configuration

  • Our computers are given static IP's. This requires a manual setup of the network. This way, the IP address is always the same and allows more control over the network setup.

Netmask

  • Determines your permissions on the network. (ie what you can do and who you can see)

Gateway

  • Allows you access from inside the network to outside the network. It acts as a gateway to the outside world.

Domain Name Servers - (DNS)

  • Translates the name or url of a computer or website (www) to the IP address of the computer. Our computers know their own DNS Servers. The DNS Servers either know the computer we want to contact or they know a computer who knows the computer we want to contact or they know a computer who knows a computer who knows a computer that knows the computer we want to contact. This is called networking- between them all they know everything.
  • We list two DNS servers in case one of them goes down. This is our access to the world wide web we don't want to be without it.

Network Configuration

During the installation process we set up the Network configuration for our computers - but sometimes we need to see what that configuration is or we need to change it due to a typo or a change in our network.

To view your current configuration in Command Line Install, use either of these commands:

  • ip a
  • ip addr show

To change your IPv4 address, sudo vim the yaml file found in /etc/netplan (use the IP address that works with your VLAN):

  • sudo vim /etc/netplan/00_installer_config.yaml

NOTE: ens4 represents the interface. Use ip a to locate the proper interface for your system.

Add the fields and configure them as shown with the IP address that works for your VLAN.
Remove the line with DHCP in it. For example:

network:
	ethernets:
		ens4:
    		addresses: [ 144.38.218.131/29 ]
    		gateway4:  144.38.218.129
    		nameservers:
            		search:  [ cs.dixie.edu ]
            		addresses:
                    		- "144.38.192.2"
                    		- "144.38.192.3"
version: 2

Note that after your IP address, put /29 to indicate the CIDR. /29 is the CIDR that works with the VMs we use for this class. At home or elsewhere, this value will vary based on your IP address scheme.

After changing the IP address, restart the network interface by typing:

  • sudo netplan apply

Another way: after changing the IP address, restart the network interface by typing:

  • ip link set ens4 down; ip link set ens4 up

Package Management

Installing Packages (Software) - requires sudo permissions

Linux packages have the following extensions:

  • .deb for debian based software. Ubuntu is debian based.

  • .rpm for redhat based software. CentOS is redhat based.

apt is a debian based program.

Remember that apt is an upgraded version of apt-get. It also includes apt-cache in the upgrade. You can choose to use the generic apt or to specify apt-get and apt-cache.

To search for possible software to install, in Ubuntu, we use the apt-cache program with the following format:

  • apt-cache search <name>
  • apt search <name>

sudo apt-cache search game | less

  • this will search for packages or programs that match <name>)

apt searches the repository for the package or program and installs it. Using apt-get to install or upgrade will install/upgrade all required packages for the particular program you've chosen.

apt-get update will update the list of available programs to install. It doesn't actually update any programs. It doesn't hurt to always update before installing just in case.

  • apt-get update <name optional>
  • apt update <name optional>

apt-get install <name> will install a program.
apt install <name>

  • sudo apt-get install openssh-server
  • sudo apt-get install emacs

apt-get upgrade will update the program specified.

  • apt-get upgrade <name>
  • apt upgrade <name>

To show all the packages installed using apt

  • cat /var/cache/apt/archives

To install an individual package or program you've downloaded.

  • dpkg -i <name>

To list all the installed packages

  • dpkg -l

yum is similar to apt it is a redhat based command

yum install <name>

  • yum install openssh-server

Repositories

Repositories are a collaboration of the work of many programmers. It is a combination of the Linux kernel, plus the Ubuntu distribution software, plus extra programs and packages. Repositories store this software in such a way that when we request updates to our current installation we only get the new files that need updating and don't have to re-download all files in our system.

The Ubuntu repository components are:

  • Main - Officially supported software.

  • Restricted - Supported software that is not available under a completely free license.

  • Universe - Community maintained software, i.e. not officially supported software.

  • Multiverse - Software that is not free.

Our repository url's are stored at /etc/apt/sources.list

Textbook Time

Textbook reading is optional. It describes package management and repositories in detail.