MODUL 3 - Creating An Interconnected IP Network
MODUL 3 - Creating An Interconnected IP Network
MODUL 3 - Creating An Interconnected IP Network
INFORMATIKA
UNIVERSITAS MULAWARMAN
II. IPV4
Internet Protocol version 4 (IPv4) is a core protocol of the TCP/IP protocol suite and
works at the Internet layer in the TCP/IP model or the network layer in the Open System
Interconnection (OSI) model. The network layer provides connectionless data transmission.
Each IP datagram is transmitted independently, removing the need to establish a connection
before IP datagrams are sent.
Network topology is the topological structure of a network and may be depicted physically
or logically. It is an application of graph theory wherein communicating devices are modeled
as nodes and the connections between the devices are modeled as links or lines between the
nodes. Physical topology is the placement of the various components of a network (e.g., device
location and cable installation), while logical topology illustrates how data flows within a
network. Distances between nodes, physical interconnections, transmission rates, or signal
types may differ between two different networks, yet their logical topologies may be identical.
A network’s physical topology is a particular concern of the physical layer of the OSI model.
R1, R2, and R3 are gateways of their networks. You need to configure these gateways to
connect these networks.
Step2 Display the IP address of the current interface and the routing table of the router.
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 4 Routes : 4
127.0.0.0/8 Direct 0 0 D
127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D
127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D
127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D
127.0.0.1 InLoopBack0
InLoopBack0 uses the fixed loopback address 127.0.0.1/8 to receive data packets destined
for the host where InLoopBack0 resides. The IP address of the InLoopBack0 interface
cannot be changed or advertised using a routing protocol.
R1 GigabitEthernet0/0/1 10.0.13.1/24
GigabitEthernet0/0/3 10.0.12.1/24
R2 GigabitEthernet0/0/3 10.0.12.2/24
GigabitEthernet0/0/4 10.0.23.2/24
R3 GigabitEthernet0/0/1 10.0.13.3/24
GigabitEthernet0/0/3 10.0.23.3/24
<R1>system-view
[R1]interface GigabitEthernet0/0/1
[R1-GigabitEthernet0/0/1]ip address 10.0.13.1 24
[R1-GigabitEthernet0/0/1]quit
[R1]interface GigabitEthernet0/0/3
[R1-GigabitEthernet0/0/3]ip address 10.0.12.1 24
[R1-GigabitEthernet0/0/3]quit
<R2>system-view
[R2]interface GigabitEthernet0/0/3
[R2-GigabitEthernet0/0/3]ip address 10.0.12.2 24
[R2-GigabitEthernet0/0/3]quit
[R2]interface GigabitEthernet0/0/4
[R2-GigabitEthernet0/0/4]ip address 10.0.23.2 24
[R2-GigabitEthernet0/0/4]quit
<R3>system-view
[R3]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1]ip address 10.0.13.3 24
[R3-GigabitEthernet0/0/1]quit
[R3]interface GigabitEthernet0/0/3
[R3-GigabitEthernet0/0/3]ip address 10.0.23.3 24
[R3-GigabitEthernet0/0/3]quit
[R1]ping 10.0.12.2
PING 10.0.12.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=70 ms
Reply from 10.0.12.2: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 10.0.12.2: bytes=56 Sequence=3 ttl=255 time=40 ms
Reply from 10.0.12.2: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.0.12.2: bytes=56 Sequence=5 ttl=255 time=50 ms
[R1]ping 10.0.13.3
PING 10.0.13.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.13.3: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 10.0.13.3: bytes=56 Sequence=2 ttl=255 time=60 ms
Reply from 10.0.13.3: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 10.0.13.3: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.0.13.3: bytes=56 Sequence=5 ttl=255 time=30 ms
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 10 Routes : 10
10.0.12.0/24 Direct
0 0 D 10.0.12.1 GigabitEthernet0/0/3
10.0.12.1/32 Direct
0 0 D 127.0.0.1 GigabitEthernet0/0/3
10.0.12.255/32 Direct
0 0 D 127.0.0.1 GigabitEthernet0/0/3
10.0.13.0/24 Direct
0 0 D 10.0.13.1 GigabitEthernet0/0/1
10.0.13.1/32 Direct
0 0 D 127.0.0.1 GigabitEthernet0/0/1
10.0.13.255/32 Direct
0 0 D 127.0.0.1 GigabitEthernet0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
The preceding command output shows that three direct routes are automatically generated
for each interface after the IP addresses of the interfaces are configured, which are
3. The host route to the broadcast address of the network where the
interface resides
R1 LoopBack0 10.0.1.1/32
R2 LoopBack0 10.0.1.2/32
R3 LoopBack0 10.0.1.3/32
Loopback interfaces are logical interfaces manually configured and do not exist physically.
Logical interfaces can be used to exchange data. A loopback interface is always Up at
the physical layer and link layer unless it is manually shut down. Generally, a loopback
interface uses a 32-bit mask. Loopback interfaces are used for the following purposes:
In this lab activity, the loopback interfaces are used to simulate clients.
[R1]interface LoopBack0
[R1-LoopBack0]ip address 10.0.1.1 32
[R2]interface LoopBack0
[R2-LoopBack0]ip address 10.0.1.2 32
[R3]interface LoopBack0
[R3-LoopBack0]ip address 10.0.1.3 32
# Display the routing table on the router (R1 in this example).
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
# Test connectivity.
# Test connectivity.
Step3 Configure a path from R1 to R2 via R3 as the backup path from LoopBack0 of R1 to
LoopBack0 of R2.
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
[R2]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
# Shut down GigabitEthernet0/0/3 interface on R1 and R2 to invalidate the route with the
highest priority.
[R1]interface GigabitEthernet0/0/3
[R1-GigabitEthernet0/0/3]shutdown
# Display the routing table on R1 and R2. The command output shows that the routes with
a lower priority are activated when the routes with a higher priority are invalidated.
[R1]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 10 Routes : 10
[R2]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 10 Routes : 10
# Test connectivity.
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 60/78/110 ms
# Trace the path of the data packets.
1 10.0.13.3 40 ms 30 ms 50 ms
2 10.0.23.2 80 ms 80 ms 60 ms
The tracert command displays the path of packets from the source to the destination.
The command output shows that the data packets pass through GigabitEthernet0/0/1 and
GigabitEthernet0/0/3 of R3 and are then forwarded to GigabitEthernet0/0/4 of R2.
In some lab environments, the devices may not respond to ICMP packets for security
reasons. Therefore, the results may vary. You can press Ctrl+C to end the tracert
operation.
Step4 Configure default routes to connect the LoopBack0 interface of R1 and the
LoopBack0 interface of R2.
[R1]interface GigabitEthernet0/0/3
[R1-GigabitEthernet0/0/3]undo shutdown
[R1-GigabitEthernet0/0/3]quit
[R1]undo ip route-static 10.0.1.2 255.255.255.255 10.0.12.2
[R1]undo ip route-static 10.0.1.2 255.255.255.255 10.0.13.3 preference 100
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
Verification
You can run the ping and tracert commands to test the connectivity between loopback0
interfaces on
0.0.0.0/0 Static 60 0 RD 10.0.12.2 GigabitEthernet0/0/3
----End
different devices.
Configuration Reference
Configuration on R1
#
sysname R1
#
interface GigabitEthernet0/0/1
ip address 10.0.13.1 255.255.255.0
#
interface GigabitEthernet0/0/3
#
sysname R2
#
interface GigabitEthernet0/0/3
ip address 10.0.12.2 255.255.255.0
#
interface GigabitEthernet0/0/4
ip address 10.0.23.2 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.2 255.255.255.255
#
ip route-static 10.0.1.1 255.255.255.255 10.0.12.1
ip route-static 10.0.1.1 255.255.255.255 10.0.23.3 preference 100
ip route-static 10.0.1.3 255.255.255.255 10.0.23.3
#
return
Configuration on R3
#
sysname R3
#
interface GigabitEthernet0/0/1
ip address 10.0.13.3 255.255.255.0
#
interface GigabitEthernet00/3
ip address 10.0.23.3 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.3 255.255.255.255
#
ip route-static 10.0.1.1 255.255.255.255 10.0.13.1
ip route-static 10.0.1.2 255.255.255.255 10.0.23.2
#
return
V. OSPF ROUTING
OSPF stands for Open Shortest Path First, which is an IGRP (Interior Gateway
Routing Protocol) type routing protocol that can only operate or work within a company or
organization's internal network.
What is meant by the internal network here is a network where you still have full
privilege to use, manage or modify it. In other words, you still have administration rights in
the network. If you no longer have the right to set up or modify the network, then the
network is no longer categorized as an internal network, but is categorized as an external
network.
In addition, OSPF is also an open standard routing protocol. That is, this OSPF was not
created by any vendor. That way, anyone can use it, any device can be compatible with it,
and it can be implemented anywhere.
Configuration Roadmap
1. Create OSPF processes on the devices and enable OSPF on the interfaces.
Configuration Procedure
Step1 Complete basic device configuration.
# Follow steps 1, 2, 3, and 4 in lab 1 to name the routers and configure the IP addresses of
the physical and loopback interfaces.
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
[R1]ospf 1
You can set OSPF parameters only after creating an OSPF process. OSPF supports multiple
independent processes on one device. Route exchange between different OSPF
processes is similar to that between different routing protocols. You can specify a
process ID when creating an OSPF process. If no process ID is specified, the default
process ID 1 is used.
# Create an OSPF area and specify the interfaces on which OSPF is to be enabled.
[R1-ospf-1]area 0
The area command creates an OSPF area and displays the OSPF area view.
1. The mask length of the interface's IP address is not shorter than that specified in the
network command. OSPF uses reverse mask. For example 0.0.0.255 indicates that the
mask length is 24 bits.
2. The address of the interface must be within the network range specified in the network
command.
In this example, OSPF can be enabled on the three interfaces, and they are all added to area
0.
[R2]ospf
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.12.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.23.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.0.1.2 0.0.0.0
If the wildcard mask in the network command is all 0s and the IP address of the interface is
the same as the IP address specified in the network-address command, the interface
also runs OSPF.
[R3]ospf
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.13.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.0.23.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.0.1.3 0.0.0.0
Step3 Display the OSPF status.
Neighbors
[R1]interface GigabitEthernet0/0/1
[R1- GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher HCIA-Datacom
[R1]interface GigabitEthernet0/0/3
[R1- GigabitEthernet0/0/3]ospf authentication-mode md5 1 cipher HCIA-Datacom
[R1- GigabitEthernet0/0/3]display this
#
interface GigabitEthernet0/0/3
ip address 10.0.12.1 255.255.255.0
ospf authentication-mode md5 1 cipher foCQTYsq-4.A\^38y!DVwQ0#
#
The password is displayed in cipher text when you view the configuration because cipher
means cipher-text.
[R2]interface GigabitEthernet0/0/3
[R2- GigabitEthernet0/0/3]ospf authentication-mode md5 1 cipher HCIA-Datacom
[R2]interface GigabitEthernet0/0/4
[R2- GigabitEthernet0/0/4]ospf authentication-mode md5 1 cipher HCIA-Datacom
# Display OSPF neighbors on R2.
[R2]display ospf peer brief
[R3]ospf
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher HCIA-Datacom
# Display OSPF neighbors on R3.
Step5 Assume that R1 is the egress of all networks. Therefore, R1 advertises the default
route to OSPF.
[R1]ospf
[R1-ospf-1]default-route-advertise always
The default-route-advertise command advertises the default route to a common OSPF
area. If the always argument is not specified, the default route is advertised to other
routers only when there are active non-OSPF default routes in the routing table of the
local router. In this example, no default route exists in the local routing table. Therefore,
the always argument needs to be used.
[R2]display ip routing-table
Route Flags: R - relay, D - download to fib
--------------------------------------------------------------------------------------------------------------------
----
Routing Tables: Public
Destinations : 15 Routes : 16
[R3]display ip routing-table
Route Flags: R - relay, D - download to fib
--------------------------------------------------------------------------------------------------------------------
----
Routing Tables: Public
Destinations : 15 Routes : 16
Step6 Change the cost values of interfaces on R1 so that LoopBack0 on R1 can reach
LoopBack0 on R2 via R3.
# According to the routing table of R1, the cost of the route from R1 to LoopBack0 of R2 is
1, and the cost of the route from R1 to R2 via R3 is 2. Therefore, you only need to
change the cost of the route from R1 to LoopBack0 of R2 to ensure that the value is
greater than 2.
[R1]interface GigabitEthernet0/0/3
[R1- GigabitEthernet0/0/3]ospf cost 10
# Display the routing table of R1.
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
--------------------------------------------------------------------------------------------------------------------
------------
Routing Tables: Public
Destinations : 14 Routes : 14
1 10.0.13.3 40 ms 50 ms 50 ms
2 10.0.23.2 60 ms 110 ms 70 ms
----End
Verification
1. Test the connectivity between interfaces on different devices using Ping.
2. Shut down interfaces to simulate link faults and check the changes in routing tables.
Configuration Reference
Configuration on R1
#
sysname R1
#
interface GigabitEthernet0/0/1
ip address 10.0.13.1 255.255.255.0
ospf authentication-mode md5 1 cipher
%^%#`f*R'6q/RMq(+5*g(sP~SB8oQ49;%7WE:07P7X:W%^%#
#
interface GigabitEthernet0/0/3
ip address 10.0.12.1 255.255.255.0
ospf cost 10
ospf authentication-mode md5 1 cipher
%^%#]e)pBf~7B0.FM~U;bRAVgE$U>%X;>T\M\tLlYRj2%^%#
#
interface LoopBack0
ip address 10.0.1.1 255.255.255.255
#
ospf 1
default-route-advertise always
area 0.0.0.0
network 10.0.1.1 0.0.0.0
network 10.0.12.0 0.0.0.255
network 10.0.13.0 0.0.0.255
#
return
Configuration on R2
#
sysname R2
#
interface GigabitEthernet0/0/3
ip address 10.0.12.2 255.255.255.0
ospf authentication-mode md5 1 cipher
%^%#z+72ZaTk2+v/g7E~AmR"NFYAKC>LZ8~Y`[**Gh=&%^%#
#
interface GigabitEthernet0/0/4
ip address 10.0.23.2 255.255.255.0
ospf authentication-mode md5 1 cipher %^%#=@2jEBu!{&UYoB*(RDVLc5t~<1B_a-
PwC$WH%jQ3%^%#
#
interface LoopBack0
ip address 10.0.1.2 255.255.255.255
#
ospf 1
area 0.0.0.0
network 10.0.1.2 0.0.0.0
network 10.0.12.2 0.0.0.0
network 10.0.23.2 0.0.0.0
#
return
Configuration on R3
#
sysname R3
#
interface GigabitEthernet0/0/1
ip address 10.0.13.3 255.255.255.0
#
interface GigabitEthernet0/0/3
ip address 10.0.23.3 255.255.255.0
#
interface LoopBack0
ip address 10.0.1.3 255.255.255.255
#
ospf 1
area 0.0.0.0
authentication-mode md5 1 cipher %^%#Rl<:SVln1M>[Gk"v/OeSEW|:0:4*h;b|-
d:N"s{>%^%#
network 10.0.1.3 0.0.0.0
network 10.0.13.3 0.0.0.0
network 10.0.23.3 0.0.0.0
#
return