0% found this document useful (0 votes)
33 views69 pages

Cisco Router CLI and Routing Basics

The document provides an overview of TCP/IP network fundamentals, specifically focusing on basic routing and the components of a Cisco router. It details the functions of various hardware components, the Cisco IOS operating system, and how to access the command line interface (CLI) for router configuration. Additionally, it explains routing processes, static and dynamic routing, and the use of routing protocols like RIP and OSPF.

Uploaded by

thngziqin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views69 pages

Cisco Router CLI and Routing Basics

The document provides an overview of TCP/IP network fundamentals, specifically focusing on basic routing and the components of a Cisco router. It details the functions of various hardware components, the Cisco IOS operating system, and how to access the command line interface (CLI) for router configuration. Additionally, it explains routing processes, static and dynamic routing, and the use of routing protocols like RIP and OSPF.

Uploaded by

thngziqin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

UEEN2013/UEEN2423

TCP/IP Network Fundamentals


(Topic 04)

Basic Routing
(A) Router

• The basic purpose of a router


– Computers that specialize in sending packets over the
data network.
– They are responsible for interconnecting networks by
selecting the best path for a packet to travel and
forwarding packets to their destination
– Handling logical addresses (IP addresses)
Hardware Component of a Cisco Router
• Router components and their functions”
– CPU - Executes operating system instructions
– Random access memory (RAM) - Contains the running copy of
configuration file. Stores routing table. RAM contents lost when
power is off
– Read-only memory (ROM) - Holds diagnostic software used when
router is powered up. Stores the router’s bootstrap program.
– Non-volatile RAM (NVRAM) - Stores startup configuration. This
may include IP addresses (Routing protocol, Hostname of router)
– Flash memory - Contains the operating system (Cisco IOS)
– Interfaces - There exist multiple physical interfaces that are used
to connect network. Examples of interface types:
• Ethernet / fast Ethernet interfaces
• Serial interfaces
• Management interfaces
Cisco IOS
• Similar to a personal computer, a router cannot
function without an operating system.
• The Cisco Internetwork Operating System (IOS) is
the system software in Cisco devices.
• The Cisco IOS provides devices with the following
network services:
– Basic routing functions
– Reliable and secure access to networked resources
– Network scalability
Command Line Interface (CLI)

• The services provided by the Cisco


IOS are generally accessed using a
command line interface (CLI).
• CLI is the “place” where you put in
the commands in order to perform
the router configuration such as:
– Setting IP address for router ports.
– Setting routes
– Showing routers statistics, etc.
Accessing CLI
• There are 3 ways to access the CLI environment.
– Console
– Telnet or SSH
– AUX port
– Above 3 are the management interfaces
Accessing CLI – Console port
• You need 2 items + 1 software to access the CLI via the console port
– PC,
– Rollover Cable
– Comm software (e.g. HyperTerminal),
• Rollover cable is a cable with a serial comm connect at one end, and a
RJ-45 connector at the other end.
• Rollover connects the serial comm port of a PC to the console port of a
router.
Accessing CLI – Console port
• The console port is often used to access a router
– when the networking services have not been started or have failed.
– When a router is first placed into service, networking parameters
have not yet been configured yet.
– The initial configuration of the network device
– Disaster recovery procedures and troubleshooting where remote
access is not possible
– Password recovery procedures

• Accessing CLI through console port can’t be done remotely


(from a far)
– One has to be done next to the router with a PC/laptop
Accessing CLI – Console port
• HyperTerminal in Windows is the software that you
can use to access the CLI environment.
– You can set the HyperTerminal Configuration as shown
Accessing CLI Remotely – Telnet & Aux
• Two ways to access CLI for “afar” or remotely:
– Aux port
• via a telephone dialup connection using a modem connected to the
router's AUX port.
• Similar to the console connection, this method does not require any
networking services to be configured or available on the device.
• The AUX port can also be used locally, like the console port, with a direct
connection to a computer running a terminal emulation program.
– telnet
• via the networking ports (FastEthernet Ports: e.g. fa0/0, Ethernet ports,
serial ports).
• Telnet service has to be setup via the console port first.

Telnet Telnet Aux Telnet


Router CLI mode
• CLI mode = prompt
• Different modes accept different sets of commands
• Just remember= different prompts cater for different
commands
User and Privileged Mode
• User mode can only access limited commands
– Prompt ‘>’
– Can use “show” commands
– Can’t make configuration which changes the router.

• Privilege mode is where you can enter commands


that can configure the router
– Prompt ‘#’
– Only after the command “enable” you can start to enter
other commands that can make changes to the router.
Right Command at the right prompt
• You have to be in the right “prompt” before a command can be “accepted”.
• In router CLI, not only you need to memorize the commands (and their effect),
but also the “correct prompt” that you key in the command.
• So beware of the prompt (or CLI mode) when you configure the Cisco router.

Router>int fa0/0
^
Commands
% Invalid input detected at '^' marker.
at the “wrong”
prompt.
Router>en
Router#int fa0/0
^
% Invalid input detected at '^' marker.

Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#
Router Commands Hot-Keys
Some Examples of Cisco Commands
Turn on Telnet Service with Password

• To “remotely” telnet into the router via the data ports (e.g.
fa0/0)
• The following shows the commands that turn on the telnet
service of the router.
– vty = ( Virtual TeletYpe), treat this as telnet
– 0 4 = accepting channel 0 to channel 4, concurrently 5 telnet users
can log in.

uccn1003#conf t
uccn1003(config)#line vty 0 4
uccn1003(config-line)#password <password>
uccn1003(config-line)#login
uccn1003(config-line)#end
uccn1003#
Running-configuration
Choo#show run
Building configuration...
• The active configuration file !
version 12.4
of the router. !
hostname Choo
• Stored in RAM !
enable password uccn1003
– If the power is turned-off, the interface FastEthernet0/0
running-configuration will be ip address [Link] [Link]
!
GONE. interface FastEthernet0/1
no ip address
• Command “show run”. shutdown
!
– You need to view the interface Vlan1
running-config in order to no ip address
shutdown
troubleshoot the router. !

line con 0
line vty 0 4
password network
login
!
end

Choo#
Startup-configuration
• Stored in NVRAM. Choo#show start
startup-config is not present
• Load in as running-config during Choo#copy run start
Destination filename [startup-config]?
the router startup. Building configuration...
[OK]
• Command for viewing the Choo#show start
Using 508 bytes
startup-config: “show start” !
version 12.4
• Backing up running-config in !
hostname Choo
startup-config: “copy run start” !
enable password uccn1003
– Note, when you turn off switches or !
interface FastEthernet0/0
routers and then turn them back on, ip address [Link]
they will load their startup [Link]
!
configuration files. interface FastEthernet0/1
– If you do not backup the running no ip address
shutdown
configuration, it will be lost. !
end
Voiding or Canceling commands
• To remove a command from the configuration, Router#show run
simply go to the proper location or prompt and Building configuration...
type "no" followed by the command to be
removed. !
version 12.4
• The following example shows
!
– How to remove hostname hostname Router
– How to remove enable password !
– How to remove an IP address in int fa0/0 interface FastEthernet0/0
– Please compare the running-config on the right, no ip address
with the running-config at the previous two slides. !
interface FastEthernet0/1
no ip address
Choo# shutdown
Choo#conf t !
Choo(config)#no hostname Choo line con 0
Router(config)#no enable password line vty 0 4
password network
Router(config)#int fa0/0 login
Router(config-if)#no ip address !
Router(config-if)# end
Conclusion
• You have been shown the basic overview of Cisco
Router
– Cisco CLI and how to access it
– Console port and rollover cables
– CLI modes and prompts
– Some simple cisco commands
– Running-config & startup-config.
(B) Introduction to Routing
Introduction to Routing
• Routing is the process of “directing” data from one network to
another network.

• Routing works with IP address


– does NOT work with port number or MAC address

• Routing needs two things:


– Data containing IP address (especially destination IP)
– Routing Table in Routers.

• Routing has to function on scalable network.


– Scalable means the network is constantly growing or contracting.
Routing Process in Router
• A router must perform the following steps while
making routing decision:
– The router receives data (with IP address, both source IP
and destination IP) from an interface.
– The router then checks destination IP of the data to see if
the destination network address exists (inclusive of default
route) in its routing table.
• If Yes: From the routing table, the router determines which
interface to use to forward the packet.
• If no, the router will discard the packet and send an ICMP
destination network unreachable message to the source of the
packet.
– The packet continues this process until it reaches its
destination.
Forwarding
• A router MUST have the capability to forward
packets.

• Definition of Forwarding:
– Placing a packet from a inbound interface to a outbound
interface.

Data come
through
this port.

Router “forwards”
the data to the outbound port
IP Routing Rule #1
• If there are 2 or more routers in a network, you
need to configure routes in the routers.
Checking Routing Table in Cisco
• The command to check routing table in cisco
– #show ip route or #sh ip ro
IP Routing Rule #2
• Routes can be set using static routes or dynamic
routes.

• Static routes are set manually by network


administrator.

• Dynamic routes are set by software, routing


protocol software. Routers will learn the
destination networks automatically.
Setting Static Routes - 1
• PC0 can ping
– [Link]
– [Link]
• However, PC0 can’t ping
– [Link]
– [Link]
• Why?
Setting Static Routes - 2
• The routing table of Router0
– Router0 only knows the two neighboring subnets that are
connected to it.
• [Link]/24 and [Link]/24
– Router0 does not know the existence of network [Link]/24
– We need to set a route in Router0 to point to [Link]/24

C = connected
Setting Static Routes - 3

Destination
network
gateway

Router0#conf t
Router0(config)#ip route [Link] [Link] [Link]
Router0(config)#

Syntax of static route


Router(config)#ip route destination_network subnet_mask [nexthop_IP
or own_int]
Setting Static Routes - 4
• After the “ip route” command, Router0 knows the existence
of [Link]/24 via gateway IP [Link]
Setting Static Routes - 5

gateway

Destination
network

Router1#conf t
Router1(config)#ip route [Link] [Link] [Link]
Router1(config)#
Setting Static Routes - 6
• After the ip route command, Router1 knows the existence
of [Link]/24 via gateway IP [Link]
Routing protocols
Two types: distance vector and link state

A) Distance vector routing protocols (Ex: RIP)


• It involves two factors:
– the distance, or metric, of a destination, and
– the vector, or direction to take to get there.
• Routing information is only exchanged between directly
connected neighbors and can't see beyond its own
neighbors - "routing by rumor“.

B) Link state routing protocols (Ex: OSPF)


• requires that all routers know about the paths reachable by
all other routers in the network.
Characteristics of RIP
• RIP is a distance vector routing protocol.
• RIP uses hop count as its only metric for path
selection.
• Advertised routes with hop counts greater
than 15 are unreachable.
• Messages are broadcast every 30 seconds.
• RIP is a classful routing protocol. RIPv1 does
not send subnet mask information in the
update.
Setting Dynamic Routes – RIP
• Setting dynamic routes with RIP (routing information
protocol). Router1(config)#router rip
Network command is used to add Router1(config-router)#network
Router1(config-router)#network
[Link]
[Link]
router’s directly connected networks Router1(config-router)#exit
That you want to advertise to others Router1(config)#
Router0(config)#router rip
Router0(config-router)#network [Link]
Router0(config-router)#network [Link]
Router0(config-router)#exit
Router0(config)#
Setting Dynamic Routes - RIP
• Routing tables of two routes with dynamic routes.
[Link]/24 is subnetted, 1 subnets
C [Link] is directly connected, FastEthernet0/0
C [Link]/24 is directly connected, FastEthernet0/1
R [Link]/24 [120/1] via [Link], [Link], FastEthernet0/0

[Link]/24 is subnetted, 1 subnets


C [Link] is directly connected, FastEthernet0/0
R [Link]/24 [120/1] via [Link], [Link], FastEthernet0/0
C [Link]/24 is directly connected, FastEthernet0/1
Setting Dynamic Routes - OSPF
Setting Dynamic Routes - OSPF
Router0:
router ospf 1 process id ranges from 1 to 65535
network [Link] [Link] area 0 area 0 is the backbone area
network [Link] [Link] area 0
network [Link] [Link] area 0

Router1:
router ospf 1
network [Link] [Link] area 0
network [Link] [Link] area 0
why network [Link] is not added?

Router2:
router ospf 1
network [Link] [Link] area 0
network [Link] [Link] area 0
network [Link] [Link] area 0
network [Link] [Link] area 0
IP Routing Rule #3
• In the routing table, the “connected” networks are
shown when we configure the IP address for the
router interfaces.

There are supposedly 4 subnets


connected to Router0.

Why the routing table only shows 3


subnets?

Router#show ip route

[Link]/24 is subnetted, 1 subnets
C [Link] is directly connected, FastEthernet0/1
C [Link]/24 is directly connected, FastEthernet0/0
C [Link]/24 is directly connected, FastEthernet1/1
Commands for the previous example
Router(config)#int fa0/0
Router(config-if)#ip addr [Link] [Link]
• Fa1/0 is NOT set with
Router(config-if)#no shut an IP, thus the routing
table does not show
Router(config-if)#int fa0/1 the subnet attached to
Router(config-if)#ip addr [Link] [Link] it as “connected”
Router(config-if)#no shut – Though the interface
is turn “on” with “no
Router(config-if)#int fa1/0
shut”
Router(config-if)#no shut

Router(config-if)#int fa1/1
Router(config-if)#ip addr [Link] [Link]
Router(config-if)#no shut

Router#show ip int br
Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 [Link] YES manual up up


FastEthernet0/1 [Link] YES manual up up
FastEthernet1/0 unassigned YES unset up up
FastEthernet1/1 [Link] YES manual up up
IP Routing Rule #4: Default Route
• Default route is the gateway of last resort. If a router can’t
find a matching destination network in the routing table, the
data will go the way of default route

• Default route is a special static route.


– It is similar in concept to default gateway.

• Command in Cisco router:


Router(config)#ip route [Link] [Link] nexthop_IP

• Apply default route smartly, you can save a lot of work.


Example of Applying Default Route - 1

• Question:
– How do we set static routes in Router4 for this
network?
Example of Applying Default Route - 2
Router4(config)#ip route [Link] [Link] [Link]
Router4(config)#ip route [Link] [Link] [Link]
Router4(config)#ip route [Link] [Link] [Link]
Router4(config)#ip route [Link] [Link] [Link]
Router4(config)#ip route [Link] [Link] [Link]
Router4(config)#ip route [Link] [Link] [Link]
Router4(config)#

Router4#show ip route
………
Gateway of last resort is not set

[Link]/24 is subnetted, 1 subnets


S [Link] [1/0] via [Link]
S [Link]/24 [1/0] via [Link]
S [Link]/24 [1/0] via [Link]
C [Link]/24 is directly connected, FastEthernet0/0
S [Link]/24 [1/0] via [Link]
S [Link]/24 [1/0] via [Link]
S [Link]/24 [1/0] via [Link]
C [Link]/24 is directly connected, FastEthernet0/1
Example of Applying Default Route - 3

• In the network, we face problems with Internet, if we don’t


have default route.
• We need to program all the subnets in the world in the
router.
• However, if we use default route, the “ip route” commands
in Router4 can be simplified to:

Router4(config)#ip route [Link] [Link] [Link]


Router4(config)#ip route [Link] [Link] [Link]
Router4(config)#ip route [Link] [Link] [Link]
Router4(config)#ip route [Link] [Link] [Link]
Example of Applying Default Route - 4
• All destination IP of subnet
[Link] will go to gateway
[Link], except the following
subnets:
– 190.1.1.x
– 193.200.30.x
– 195.10.10.x

Router4#show ip route
…………
Gateway of last resort is [Link] to network [Link]

All other [Link]/24 is subnetted, 1 subnets


destination IP S [Link] [1/0] via [Link]
will go here.
S [Link]/24 [1/0] via [Link]
S [Link]/24 [1/0] via [Link]
C [Link]/24 is directly connected, FastEthernet0/0
C [Link]/24 is directly connected, FastEthernet0/1
S* [Link]/0 [1/0] via [Link]
Default route in Dynamic Routing - 1
• Routing table of Router4,
with dynamic routes by RIP.
– No default route is present, so
we can’t cater for the “rest” of
the destination IP other than
the ones shown in the routing
table.

Router4#show ip route
……
Gateway of last resort is not set

R [Link]/16 [120/1] via [Link], [Link], FastEthernet0/0


R [Link]/24 [120/1] via [Link], [Link], FastEthernet0/0
R [Link]/24 [120/1] via [Link], [Link], FastEthernet0/0
C [Link]/24 is directly connected, FastEthernet0/0
R [Link]/24 [120/2] via [Link], [Link], FastEthernet0/0
R [Link]/24 [120/2] via [Link], [Link], FastEthernet0/0
R [Link]/24 [120/1] via [Link], [Link], FastEthernet0/0
C [Link]/24 is directly connected, FastEthernet0/1
Default route in Dynamic Routing - 2
• Adding in the default route will ensure all other destination
IP to Internet to go to the gateway [Link] (in the case of
Router4)

Router4#show ip route
……….
Gateway of last resort is [Link] to network [Link]

R [Link]/16 [120/1] via [Link], [Link], FastEthernet0/0


R [Link]/24 [120/1] via [Link], [Link], FastEthernet0/0
R [Link]/24 [120/1] via [Link], [Link], FastEthernet0/0
C [Link]/24 is directly connected, FastEthernet0/0
R [Link]/24 [120/2] via [Link], [Link], FastEthernet0/0
R [Link]/24 [120/2] via [Link], [Link], FastEthernet0/0
R [Link]/24 [120/1] via [Link], [Link], FastEthernet0/0
C [Link]/24 is directly connected, FastEthernet0/1
S* [Link]/0 [1/0] via [Link]
IP Routing Rule #5
• Complex Network is best configured with dynamic routing.
– Dynamic routing is a process in which the routing tables are
populated by routing protocol (automatically done by software)

• Typical dynamic routing configuration comes in two parts:


– Selecting the routing protocol (there are a few popular routing
protocols)
• RIP (version 1 and 2)
• EIGRP
• OSPF
– Advertising the networks attached to routers.

• We need to provide a default route for dynamic routes too.


Advantage of Dynamic Routing
• Advantages of dynamic routing:

– A routing protocol will discover all the possible routes to


one destination, implement its predefined rules, and
come up with the best route to the destination.

– When a portion of the route to the destination has been


closed, the routing protocol will automatically find an
alternate route to the destination.

– It does not require “human” to key in all the routes,


especially in the complex networks.
Problems with Static Routes
• Complex networks includes many network elements
especially routers (and a lot of subnets).
– Hence, the network needs a lot of routes.
• Static routes do not scale well. For example:
– A network with two routers would require two static routes. (To and
fro)
– A network with three routers would require six static routes.
• A network with 100 routers would require 9,900 static routes.
• The generic equation is the same one used to determine the
number of full-mesh links in WAN networking:

– n represents the total number of routers in the internetwork.


Advertising the Network

• After selecting the routing protocol (e.g. RIP), the router needs to “advertise”
all the subnets attached it.
• For example, in the above networks:
• Router3 has 4 subnets attached it
– network [Link], network [Link], network [Link], network [Link]
• Router2 has 3 subnets attached it.
– network [Link], network [Link], network [Link]
• Router1 has 2 subnets attached it.
– Network [Link], network [Link]
IP Routing Rule #6
• If there is a new subnet in the network, all the
routers need to have the routes that point to that
subnets.

• If a subnet is being taken out of the network, all


the routers need to erase destination network in
the routing table that points to that subnet.

• If the network is not EXPLICITLY informed on the


addition of subnets, there is no way the routers of
the network will have routes pointing to the new
subnet.
Example of IP Routing Rule #6

• In dynamic routing if Router2 has not EXPLICITLY advertise the


network of [Link], Router1 will not no way to know the existence of
the new subnet [Link] which is attached to Router2.
Router1#show ip route

Gateway of last resort is not set

C [Link]/24 is directly connected, FastEthernet0/1


R [Link]/24 [120/1] via [Link], [Link], FastEthernet0/0
C [Link]/24 is directly connected, FastEthernet0/0
Example of IP Routing Rule #6
Router(config)#router rip
Router(config-router)#network [Link]

• Router2 just need to advertise [Link] (new subnets), since it has


advertised the two older subnets to the network.
Router1#show ip route

Gateway of last resort is not set

C [Link]/24 is directly connected, FastEthernet0/1


new R [Link]/24 [120/1] via [Link], [Link], FastEthernet0/0
entry C [Link]/24 is directly connected, FastEthernet0/0
R [Link]/24 [120/1] via [Link], [Link], FastEthernet0/0
IP Routing Rules #7
• Router must have a routing table with entries made of
unique destination network address.
– Data must refer to routing table in order to know where to go.
• A route:
– is the “road” from source to destination
• Routing table is:
– A road map and the road direction board of the data.
– The mechanism to guide data travel from 1 LAN to another LAN
• Routing table should have:
– The destination networks addresses
– The destination network subnet mask
– The next hop (or gateway) for a particular destination network.
– The outbound interface for a particular destination network.
– A network metric
– Last resort gateway
Cisco Routing Table Example

Gateway IP (or Next Hop)


Unique destination network
[Administrative distance/ Metric=hop count]
Cisco Routing Table Explained (Top half)
• The Codes section at the very top tells you how the router
get the route
– There are few ways a route can be obtained
• C = connected (you set it)
• S = Static (you set it too)
• R, I, D, O = (from routing software, you need to configure this too)

• Note the line “Gateway of last resort is not set”.


– The gateway of last resort, also known as a default route, is where
your router will send IP packets if there isn’t a match in the routing
table.

• After that, are the “routing table entries”


Routing Table Entry Explained - 1

• R
– A code indicating how the route entry was learned on this router. In this case,
the R stands for RIP (a form of dynamic routing).
• [Link]/16
– The network address and prefix length (number of bits set to 1 in the subnet
mask) of the destination network.
• [120
– The administrative distance of the route.
• /1]
– The metric of the route specific to the routing protocol used to determine the
route.
– RIP uses hop count as its metric. In this example, there is one router between
this router and the destination.
– Different routing protocols have different set of metrics
Routing Table Entry Explained - 2

• via [Link]
– The next-hop address (gateway) for the route.
– This is the IP address that the packet will exit from the LAN in order
for the packet to reach its destination.
• [Link]
– The length of time since the route has been updated in the routing
table. In this example, the route was updated 18 seconds ago.
• Serial0
– The interface the route was learned through.
– This is also the interface the packets will be switched to in order for
the packets to be forwarded toward its destination.
Windows Routing Table Example
C:\>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 20 ed 78 85 31 ...... Realtek RTL8139 Family PCI Fast Ethernet NIC -
Packet Scheduler Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
[Link] [Link] [Link] [Link] 30
[Link] [Link] [Link] [Link] 1
[Link] [Link] [Link] [Link] 30
[Link] [Link] [Link] [Link] 30
[Link] [Link] [Link] [Link] 30
[Link] [Link] [Link] [Link] 30
[Link] [Link] [Link] [Link] 30
[Link] [Link] [Link] [Link] 1
Default Gateway: [Link]
===========================================================================
Routing Table Explained - 1
• Windows routing table is displayed with the
command “route print”

• The Network Address and Netmask columns


– show the values that are used to determine if the
destination matches the routing table entry.

• The Gateway Address and Interface columns


– tell where the packet should be forward and then sent

• Metric
– shows how "expensive" it is to send the packet.
Windows Routing Table - 2
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
[Link] [Link] [Link] [Link] 30
[Link] [Link] [Link] [Link] 1
[Link] [Link] [Link] [Link] 30
[Link] [Link] [Link] [Link] 30

• The first line of this routing table is the default route. [Link] [Link]
• The second line is the loopback route.
• The third line defines the range of addresses on the local network
segment.
– This shows that any address in the [Link] Class C network should
be found on the network segment connected to the interface with the
address [Link].
• The fourth line defines the destination addresses of a remote network
that should not be sent to the default gateway.
– This shows that any address in the [Link] Class C network should
be sent to the gateway [Link]
Windows Routing Table - 3
[Link] [Link] [Link] [Link] 30
[Link] [Link] [Link] [Link] 30
[Link] [Link] [Link] [Link] 30
[Link] [Link] [Link] [Link] 1
Default Gateway: [Link]
===========================================================================

• The fifth line is how a Microsoft routing table defines that [Link]
is an address for the local host.
– The [Link] netmask identifies that this route applies to only to
packets addressed to the single address [Link].
– The [Link] Gateway and Interface addresses pass all packets for this
address to the local host.
• The sixed entry lists the broadcast address for the local network.
– This is another entry that is automatically added when an interface on a
Windows TCP/IP system is assigned an IP address.
• The seven line is the multi-cast address.
• The eight line is the broadcast IP address used in protocols such as
dhcp.
Linux Routing Table - 1

Destination Gateway Genmask Flags Metric Ref Use Iface


[Link] * [Link] UH 0 0 0 eth0
[Link] * [Link] UH 0 0 0 eth1
[Link] [Link] [Link] UG 0 0 0 eth0
[Link] * [Link] U 0 0 0 eth0
[Link] [Link] [Link] UG 0 0 0 eth1
[Link] * [Link] U 0 0 0 eth1
[Link] * [Link] U 0 0 0 lo
[Link] [Link] [Link] UG 0 0 0 eth1

• Displayed by commands either “route –e” or “netstat –nr”


• Destination
– The destination network or destination host.
• Gateway
– The gateway address or '*' if none set.
• Genmask
– The netmask for the destination net; '[Link]' for a host
destination and '[Link]' for the default route.
Linux Routing Table - 3
• Metrics
– Same as Windows, indicating how “expensive”
the route is.
• Use
– How many times that the routing entry has been
used
• IFace
– The ethernet interface
Setting Static Routes
in Windows and Linux

Some commands to set static routes


in Windows, Linux, and Cisco
Windows Commands for Static Route
> route ADD [Link] MASK [Link] [Link] METRIC 3 IF 2
destination^ ^mask ^gateway metric^ ^
Interface^

> route CHANGE [Link] MASK [Link] [Link] METRIC 2 IF 2


CHANGE is used to modify gateway and/or metric only.

> route PRINT


> route DELETE [Link]
Static Route example in Linux
• Access individual computer host specified via network interface card
eth1:
– route add -host [Link] eth1
• Access ISP network identified by the network address and netmask
using network interface card eth0:
– route add -net [Link] netmask [Link] gw
[Link] eth0
• Conversely, meaning deleting a route:
– route del -net [Link] netmask [Link] gw
[Link] eth0
• Specify default gateway to use to access remote network via network
interface card eth0:
– route add default gw [Link] eth0

You might also like