Router and Routing Basics
Router and Routing Basics
V1.2
Objectives
Example
Dest Mask Gw Interface Owner pri metric
Directly
connected route
Static route
Dynamic route
Directly connected route
10.0.0.1/24 192.168.0.1/30
e1_1
fei_1/1
A 192.168.0.2/30 B
172.16.0.1/24
valid, the network configured on this network will appear in the route
table and associated with this interface , the route will change with
the status of the interface.
Static Route
The route manually set by the network
administrator is not updated automatically with the
change of network topology.
The route table takes effect under the condition
that the next hop is reachable.
Advantage: It does not occupy the network
resources or system resources.
Disadvantage: It needs to be configured by the
administrator manually one by one, and does not
automatically adjust with the change of network
status.
Static Route Configuration
Stub Network
172.16.1.0
SO
10.0.0.0
B A
B
Network 172.16.2.2 172.16.2.1
Stub Network
Example
172.16.1.0
SO
Network A B
172.16.2.2 172.16.2.1
RIP OSPF
10.0.0.0/16 fei_1/3
Notice : the comparison of Route table
route priority must be between
identical routes.
Default route priority
fei_1/1 10M
177.1.1.1
Network
178.1.1.1
DDN
fei_1/1 10M
177.1.1.1
Network
178.1.1.1
DDN
10.1.1.1?
Contents
A B C
MAC Port
00:20:af:00:00:01 fei_1/1
00:20:af:00:00:02 fei_1/2
Switch
Fei_1/1 Fei_1/3
Fei_1/2
ARP reply
Dest MAC:00:20:af:00:00:01
Source MAC:00:20:af:00:00:02
MAC Port
00:20:af:00:00:01 fei_1/1
00:20:af:00:00:02 fei_1/2
Switch
Fei_1/1 Fei_1/3
Dest MAC:00:20:af:00:00:02 Fei_1/2
Source MAC:00:20:af:00:00:01
A B C
Dest MAC:00:20:af:00:00:02
Dest network interface
Source MAC:00:20:af:00:00:05 10.1.1.0 255.255.255.252 fei_1/1
10.1.1.4 255.255.255.252 fei_1/2
Dest IP: 10.1.1.5 10.1.1.8 255.255.255.252 fei_1/3
Router
Source IP: 10.1.1.1
fei_1/3:10.1.1.10/30
fei_1/1:10.1.1.2/30 MAC:00:20:AF:00:00:05
MAC:00:20:AF:00:00:04
fei_1/2:10.1.1.6/30
MAC:00:20:AF:00:00:05
A B C
NO NO
Get peer MAC
Address by ARP Send data at
physical layer
YES YES
Is gateway Is the gateway MAC Data link layer
configured ? address in ARP? encapsulation
NO NO
End
Get gateway MAC
Send error message
address by ARP
IP communication process
IP communication process KEY features:
IP communication is hop by hop communication
Source IP and destination IP address is unchanged
Every time the packet passed a data link layer, there
will be a new encapsulation of the packet
The return path is not related to the forwarding path
Routing process example
R1 route table
192.168.4.0 255.255.255.0 192.168.4.1 e1_1/1.1 direct 0 0
192.168.2.0 255.255.255.0 192.168.2.1 fei_1/1 direct 0 0
192.168.1.0 255.255.255.0 192.168.4.2 e1_1/1.1 rip 120 1
192.168.1.0 /24 192.168.6.0 255.255.255.0 192.168.4.2 e1_1/1.1 rip 120 1
fei_1/1 192.168.3.0 255.255.255.0 192.168.4.2 e1_1/1.1 rip 120 2
R2
e1_1/1.1 e1_2/1.1
192.168.6.0 /24
192.168.4.0 /24
e1_1/1.1
e1_1/1.1
R3
R1
fei_1/1
fei_1/1 Destination address:
192.168.3.3 192.168.3.0 /24
192.168.2.0 /24
192.168.2.3 A B
192.168.3.3
Routing process example
R2 route table
192.168.4.0 255.255.255.0 192.168.4.2 e1_1/1.1 direct 0 0
192.168.6.0 255.255.255.0 192.168.6.1 e1_2/1.1 direct 0 0
192.168.1.0 255.255.255.0 192.168.1.1 fei_1/1 direct 0 0
192.168.2.0 255.255.255.0 192.168.4.1 e1_1/1.1 rip 120 1
192.168.1.0 /24
192.168.3.0 255.255.255.0 192.168.6.2 e1_2/1.1 rip 120 1
fei_1/1
R2
e1_1/1.1 e1_2/1.1
192.168.3.3
Routing process example
R3 route table
192.168.3.0 255.255.255.0 192.168.3.1 fei_1/1 direct 0 0
192.168.6.0 255.255.255.0 192.168.6.2 e1_1/1.1 direct 0 0
192.168.1.0 255.255.255.0 192.168.6.1 e1_1/1.1 rip 120 1
192.168.1.0 /24 192.168.4.0 255.255.255.0 192.168.6.1 e1_1/1.1 rip 120 1
fei_1/1 192.168.2.0 255.255.255.0 192.168.6.1 e1_1/1.1 rip 120 2
R2
e1_1/1.1 e1_2/1.1
192.168.2.3 192.168.3.3
Contents
fei_1/1 fei_1/1.1
fei_1/1.2 802.1Q trunk
fei_1/2
fei_1/1.3 encapsulation
fei_1/3
VLAN
VLAN
VLAN
VLAN
VLAN
VLAN
VLAN
VLAN
VLAN
three
three
three
two
two
one
one
two
one
Method 1: Method 2: Method 3: L3
Normal route One-arm route switch
Method 1: Normal Route
fei_1/3
VLAN
VLAN
VLAN
default gateway IP addresses of different
three
two
one
VLANs. The port of the switch is
configured as ACCESS PORT.
Method 2: One-arm Route
ZXR10(config)#interface fei_1/1.2
ZXR10(config-subif)#encapsulation dot1Q 2
ZXR10(config-subif)#ip add 2.1.1.1 255.0.0.0
VLAN
VLAN
VLAN
three
two
one
ZXR10(config)#interface fei_1/1.3
ZXR10(config-subif)#encapsulation dot1Q 3
ZXR10(config-subif)#ip add 3.1.1.1 255.0.0.0
Feature:
Only one router physical interface is required; low cost, good expandability; the router
needs to support the trunk encapsulation.
Configuration:
On one physical interface of the router, configure several sub-interfaces, and
encapsulate them by 802.1Q. Different sub-interfaces configure the default gateway IP
addresses of different VLANs. The port of the switch is configured as 802.1Q trunk.
Method 3: L3 Switch
ZXR10(config)#interface vlan 1
ZXR10(config-if)#ip add 1.1.1.1 255.0.0.0
ZXR10(config)#interface vlan 2
ZXR10(config-if)#ip add 2.1.1.1 255.0.0.0
ZXR10(config)#interface vlan 3
ZXR10(config-if)#ip add 3.1.1.1 255.0.0.0
VLAN
VLAN
VLAN
three
two
one
Feature:
One device integrates the routing and switching functions.
The visible interfaces are all L2 ports, and the L3 interfaces
needs to be created to be associated with VLAN.
Configuration:
Each VLAN needs to be configured with the logical interface.
Its IP address is the default gateway address of the
corresponding VLAN.
Review
Definition of router
Router’s functions
Basic concepts in routing
Working principle of a router
IP routing process within the same network
IP routing process between different network
Inter VLAN routing
Questions
What’s the two main functions of router?
How is the route table established?
What is the standard when a router is selecting
the route to route table?
When forwarding IP packet, If there are many
matches, what will router do?
Describe the encapsulation and decapsulation
during the process of IP routing .