Network Configuration Basics
Network Configuration Basics
2
Internet Addresses
Ambo University
3
IP Address Classes
Ambo University
4
IP Address Classes
Ambo University
5
Hosts for Classes of
IP Addresses
Ambo University
6
IPv4 Address Classes
Ambo University
Class D Addresses
• A Class D address begins with binary 1110 in the first octet.
• First octet range 224 to 239.
• Class D address can be used to represent a group of hosts called a
host group, or multicast group.
Class E Addresses
8
Network IDs and Broadcast Addresses
Ambo University
9
Private Addresses
Ambo University
10
Reserved Address Space
Ambo University
• Network ID
• Broadcast address
• Hosts for classes of IP addresses
• For Example: For the IP Address 192.168.0.1 with Subnet mask 255.255.255.0
– Network ID: 192.168.0.0
– Broadcast Address: 192.168.0.255
– Addresses for Hosts: 192.168.0.1 – 192.168.0.254
11
Subnetworks
Ambo University
12
Subnetworks
Ambo University
13
Subnet Mask
Ambo University
14
Subnet Mask
Ambo University
15
Range of Bits Needed to Create Subnets
Ambo University
16
Subnet Addresses
Ambo University
17
Determining Subnet Mask Size
Ambo University
18
Determining Subnet Mask Size
Ambo University
19
Subnetting Example with AND Operation
Ambo University
20
IP Configuration on a Network Diagram
Ambo University
21
Subnet Example
Ambo University
Given the Class B address 190.52.0.0
Using /24
subnet... Network Network Subnet Host
22
Subnet Example
Ambo University
23
Subnet Example
Ambo University
Network address 190.52.0.0 with /16 network mask
Using Subnets: subnet mask 255.255.255.0 or /24
26
IP addressing crisis
Ambo University
• Address Depletion
• Internet Routing Table Explosion
27
IPv4 Addressing
Ambo University
Subnet Mask
• One solution to the IP address shortage was thought to be the
subnet mask.
• Formalized in 1985 (RFC 950), the subnet mask breaks a single
class A, B or C network in to smaller pieces.
28
Short Term Solutions: IPv4 Enhancements
Ambo University
29
IPv4 versus IPv6
Ambo University
IPv4
30
Long Term Solution: IPv6 (coming)
Ambo University
31
Firewall and Its configuration (Linux)
Ambo University
• A firewall helps screen out malicious users, viruses, and
worms that try to access your network from the Internet.
• Firewalls can be hardware or software, and they help
prevent unauthorized access to your local area network
(LAN) from the Internet by blocking incoming network
traffic that is attempting to use a port that is not open.
• A firewall hides information on your LAN from the Internet,
such as computer names, network topology, and network
device types.
• A firewall can also log traffic to and from the LAN.
32
Firewall configuration….
Ambo University
• Firewall can be provided in three forms:
– Hardware firewall
– Server Software Firewall
– Client Software Firewall
• The Linux kernel includes the Netfilter subsystem, which is
used to manipulate or decide the fate of network traffic
headed into or through your server.
• Uncomplicated Firewall (ufw)
– The default firewall configuration tool for Ubuntu is ufw.
– ufw by default is initially disabled.
33
Firewall configuration…
Ambo University
• The following are some examples of how to use ufw:
– First, ufw needs to be enabled. From a terminal prompt
enter:
• sudo ufw enable
– To open a port (ssh in this example):
• sudo ufw allow 22
– Rules can also be added using a numbered format:
• sudo ufw insert 1 allow 80
– Similarly, to close an opened port:
• sudo ufw deny 22
– To remove a rule, use delete followed by the rule:
• sudo ufw delete deny 22
34
Firewall configuration…
Ambo University
• It is also possible to allow access from specific hosts or
networks to a port.
– The following example allows ssh access from host
192.168.0.2 to any ip address on this host:
• sudo ufw allow proto tcp from 192.168.0.2 to any port
22
– Replace 192.168.0.2 with 192.168.0.0/24 to allow ssh
access from the entire subnet.
– ufw can be disabled by:
• sudo ufw disable
– To see the firewall status, enter:
• sudo ufw status
35
Firewall configuration….
Ambo University
– And for more verbose status information use:
• sudo ufw status verbose
– To view the numbered format:
• sudo ufw status numbered
36
Network Interface Configuration (Linux)
Ambo University
• A linux box should have its NIC configured to communicated
on the network.
• This can be supplied by the DHCP Server dynamically or
supplied statically by the administrator
• For providing the static address the file
/etc/network/interfaces needs to edited:
– auto eth0
– iface eth0 inet static
– address 192.168.0.10
– netmask 255.255.255.0
– gateway 192.168.0.1
– network 192.168.0.0
– broadcast 192.168.0.255
37
NIC Configuration….
Ambo University
• The name resolution information needs to be provided on
the /etc/resolv.conf file
– nameserver 192.168.0.5
– nameserver 192.168.0.6
• Finally, the network service has to be started using one of
the following commands:
– service networking restart
– /etc/init.d/networking restart
– ifdown eth0 && ifup eth0
38
Network troubleshooting commands(Linux)
Ambo University
• ifconfig
– ifconfig (interface configurator) command is use to
initialize an interface, assign IP Address to interface
and enable or disable interface on demand.
– With this command you can view IP
Address and Hardware / MAC address assign to
interface and also MTU (Maximum transmission unit)
size.
– Example: ifconfig eth0
• ifconfig with interface (eth0) command only shows
specific interface details like IP Address, MAC
Address etc
39
Network troubleshooting…..
Ambo University
• Enable or Disable Specific Interface
– To enable or disable specific interfaces we use the
following commands respectively.
• ifup eth0 – enables eth0 interface
• ifdown eth0 – disables eth0 interface
• PING Command
– PING (Packet INternet Groper) command is the best
way to test connectivity between two nodes.
– Whether it is Local Area Network (LAN) or Wide Area
Network (WAN).
– Ping use ICMP (Internet Control Message Protocol) to
communicate to other devices.
40
Network troubleshooting…..
Ambo University
– You can ping host name of ip address using below
command.
• ping 192.168.0.1 – tests connectivity of the current
machine to machine 192.168.0.1
• traceroute command
– traceroute is a network troubleshooting utility which
shows number of hops taken to reach destination also
determine packets traveling path.
– Below we are tracing route to global DNS server IP
Address and able to reach destination also shows path
of that packet is traveling
41
Network troubleshooting…..
Ambo University
42
Network troubleshooting…..
Ambo University
• netstat command
– Netstat (Network Statistic) command display connection
info, routing table information etc.
– To displays routing table information use option as -r.
43
Network troubleshooting…
Ambo University
• dig command
– Dig (domain information groper) query DNS related
information like A Record, CNAME, MX Record etc.
– This command mainly use to troubleshoot DNS related
query.
• nslookup command
– nslookup command also use to find out DNS related
query. The following examples shows A Record (IP
Address) of tecmint.com.
44
Network troubleshooting…..
Ambo University
• host command
– host command helps to find name to IP or IP to name
in IPv4 or IPv6 and also query DNS records.
• hostname command
– hostname is to identify in a network.
– Execute hostname command to see the hostname of
your box.
– One can configure hostname on /etc/hostname file.
45