https://study-ccna.com Tue, 07 Apr 2020 12:15:32 +0000 en-US hourly 1 https://wordpress.org/?v=5.3.4 https://study-ccna.com/wp-content/uploads/2018/08/cropped-study_icon5-32x32.png https://study-ccna.com 32 32 Syslog message format https://study-ccna.com/syslog-message-format/ Tue, 07 Apr 2020 12:01:30 +0000 https://study-ccna.com/?p=1781 Read More ...]]> Syslog messages that appear on a Cisco device consists of several parts. Consider the following message:

*Jan 18 03:02:42: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to down

The message consists of the following parts:

  • Jan 18 03:02:42 – the timestamp
  • %LINEPROTO – the source that generated the message. It can be a hardware device (e,g. a router), a protocol, or a module of the system software.
  • 5 – the severity level, from 0 to 7, with lower numbers being more critical.
  • UPDOWN – the unique mnemonic for the message
  • Line protocol on Interface GigabitEthernet0/0, changed state to down – the description of the event

Severity levels are numbered 0 to 7:

  • 0 – emergency (System unusable)
  • 1 – alert (Immediate action needed)
  • 2 – critical events (Critical condition)
  • 3 – error events (Error condition)
  • 4 – warning events (Warning condition)
  • 5 – notification events (Normal but significant condition)
  • 6 – informal events (Informational message only)
  • 7 – debug messages (Appears during debugging only)

In our example the message has the severity level of 5, which is a notification event. The first five levels (0-4) are used by messages that indicate that the functionality of the device is affected. Levels 5 and 6 are used by notification messages, while the level 7 is reserved for debug messages.

The severity levels can be used to specify the type of messages that will be logged. For example, if you think that you are getting too many non-important messages when logged in through a console, the global configuration command logging console 2 will instruct the device to only log messages of the severity level 0, 1 and 2 to the console.

]]>
Syslog explained https://study-ccna.com/syslog-explained/ Tue, 07 Apr 2020 11:52:08 +0000 https://study-ccna.com/?p=1777 Read More ...]]> Syslog is a standard for message logging. Syslog messages are generated on Cisco devices whenever an event takes place – for example, when an interface goes down or a port security violation occurs.

You’ve probably already encountered syslog messages when you were connected to a Cisco device through the console – Cisco devices show syslog messages by default to the console users:

R1#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to down

This is because the logging console global configuration command is enabled by default. SSH and Telnet users need to execute the terminal monitor EXEC mode command in order to see the messages:

R1#terminal monitor
R1#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

In the example above you can see that the logged in user executed the terminal monitor command. Because of that, the telnet user was notified via a syslog message when the Gi0/1 interface went up a couple of moments later.

It is recommended to store the logs generated by Cisco devices to a central syslog server. To instruct a device to send logs to the syslog server, we can use the logging IP_ADDRESS command:

R1(config)#logging 10.0.0.10

Now, logs generated on R1 will be sent to the syslog server with the IP address of 10.0.0.10. Of course, you need to have a Syslog server (e.g. Kiwi syslog) installed and configured.

NOTE
It is also possible (and recommended) to use specify hostname instead of the IP address in the logging command. The command is logging host HOSTNAME.
]]>
Auxiliary Port on a Cisco router https://study-ccna.com/auxiliary-port-on-a-cisco-router/ Tue, 10 Dec 2019 10:50:45 +0000 https://study-ccna.com/?p=1565 Read More ...]]> Most Cisco routers include an additional auxiliary (Aux) port as a backup async port. This port is commonly used as a dial-up port for remote router management. It is connected to a modem and enables an administrator to make a phone call to connect to the router’s CLI.

The following figure shows how to connect a modem to an aux port on a router (image source: Cisco):

Cisco router auxiliary port

The network administrator uses a terminal emulation program to connect to the router over the aux port. The configuration of the aux port resembles the the console port configuration:

Router(config)#line aux 0
Router(config-line)#password cisco
Router(config-line)#login

The code above enables password checking for users dialing into the router.

]]>
Interface status codes https://study-ccna.com/interface-status-codes/ Fri, 06 Dec 2019 20:47:17 +0000 https://study-ccna.com/?p=1555 Read More ...]]> Interface status codes can tell you whether an interface on a Cisco router or a switch is working. Status codes of an interface can be displayed using the show interface TYPE command, e.g.:

SW1#show interface fa0/1
FastEthernet0/1 is up, line protocol is up (connected)
  Hardware is Lance, address is 0060.70d8.0001 (bia 0060.70d8.0001)
 BW 100000 Kbit, DLY 1000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)

The first line of the output indicates the working state of the interface. The first status code (known as line status) indicates that the Layer 1 is working (FastEthernet0/1 is up). The second status code (known as protocol status) indicates that Layer 2 is also working (line protocol is up) and is always Down if the line status is Down. Finally, the word at the end of the line indicates the working state of the interface (connected in our case).

All possible combinations of the status codes are given in the table below:

Cisco interface status codes

NOTE
Only interfaces with status codes of up and up will forward or receive frames.
]]>
DHCP relay agent https://study-ccna.com/dhcp-relay-agent/ Fri, 06 Dec 2019 19:54:58 +0000 https://study-ccna.com/?p=1545 Read More ...]]> When a device is configured as a DHCP client, it will send a a broadcast packet to discover DHCP servers on the network. Broadcast packets are not forwarded by routers by default, so if a DHCP server is in a different network than the DHCP client, it will not receive the request. Consider the following scenario:

No DHCP server on the segment

The workstation on the left is configured as a DHCP client. R2 on the right is configured as a DHCP server. The workstation sends a DHCP discover packet, but it receives no request, since R1 doesn’t forward the packet to R2 (broadcast packets stay on the local subnet).

To rectify this, we can configure R1 to act as a DHCP relay agent and forward the request to the configured DHCP server. This is done by issuing the ip helper-address DHCP_SERVER_IP_ADDRESS command on its Gi0/0 interface. This command instructs the router to do the following:

  1. watch for DHCP messages on the interface
  2. when a DHCP packet arrives, set the packet’s source IP address to the IP address of Gi0/0
  3. change the destination IP address of the packet from 255.255.255.255 (the broadcast address) to the IP address of the DHCP server and send it to R2
  4. when the answer from the DHCP server is received, change the packet’s destination IP to 255.255.255.255 and send it out its Gi0/0 interface, so that the workstation (which does not have an IP address yet) can receive the answer.

To configure the interface Gi0/0 on R1 to forward DHCP packets, only a single command is needed:

R1(config-if)#ip helper-address 172.16.0.2

To make sure that the workstation indeed got its IP parameters, we can issue the ipconfig command:

C:\>ipconfig

FastEthernet0 Connection:(default port)

Link-local IPv6 Address.........: FE80::2E0:B0FF:FEB3:73E
IP Address......................: 10.0.0.104
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 10.0.0.1
]]>
Configure timezone and Daylight Saving Time (DST) https://study-ccna.com/configure-timezone-and-daylight-saving-time-dst/ Sat, 02 Nov 2019 18:46:27 +0000 https://study-ccna.com/?p=1530 Read More ...]]> It is recommended to set the correct timezone and adjust the DST setting before configuring a router as an NTP client. The syntax of the command used to set the timezone is:

(config)clock timezone NAME HOURS [MINUTES]

The name of the timezone can be anything you like. After the name parameter, you need to specify the difference in hours (and optionally minutes) from Coordinated Universal Time (UTC). For example, to specify the Atlantic Standard Time, which is 4 hours behind UTC, we would use the following command:

R1(config)#clock timezone AST -4

The syntax of the command used to adjust for DST is:

(config)clock summer-time NAME recurring [week day month hh:mm week day month hh:mm [offset]]

Again, the name parameter can be anything you like. The recurring keyword instructs the router to update the clock each year. If you press enter after the recurring keyword, the router will use the U.S. DST rules for the annual time changes in April and October. You can also manually set the date and time for DST according to your location. For example, to specify the DST that starts on the last Sunday of March and ends on the last Sunday of October, we would use the following command:

R1(config)clock summer-time DST recurring last Sunday March 2:00 last Sunday October 2:00
]]>
Default static route https://study-ccna.com/default-static-route/ Sat, 02 Nov 2019 17:17:13 +0000 https://study-ccna.com/?p=1507 Read More ...]]> A default route defines where packets will be sent if no specific route for the destination network is listed in the routing table. If no default route is set, the router will discard all packets with destination addresses not found its routing table.

Consider the following example:


We have a network of three routers. R1 is directly connected to two subnets – 192.168.0.0/24 and 10.0.0.0/24. R3 is connected to the Internet.

Here is the routing table on R1:

R1#show ip route

Gateway of last resort is not set

     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       10.0.0.0/24 is directly connected, GigabitEthernet0/1
L       10.0.0.1/32 is directly connected, GigabitEthernet0/1
     192.168.0.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.0.0/24 is directly connected, GigabitEthernet0/0
L       192.168.0.1/32 is directly connected, GigabitEthernet0/0

Notice the lack of the default gateway or default route. If R1 tries to access a public IP address (e.g. 4.2.2.2), the packets will be dropped because no route to that IP address has been found in the routing table:

Dropped packet no default route

To create a default static route on R1, we need to use the following command:

R1(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.2

The command above instructs R1 to match all IP address and subnet masks and send the packets to 10.0.0.2 (the interface on R3 that is connected to R1). The routing table on R1 now looks like this:

R1#show ip route

Gateway of last resort is 10.0.0.2 to network 0.0.0.0

     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       10.0.0.0/24 is directly connected, GigabitEthernet0/1
L       10.0.0.1/32 is directly connected, GigabitEthernet0/1
     192.168.0.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.0.0/24 is directly connected, GigabitEthernet0/0
L       192.168.0.1/32 is directly connected, GigabitEthernet0/0
S*   0.0.0.0/0 [1/0] via 10.0.0.2

Notice how the gateway of last restort is now set to 10.0.0.2. There is also a route marked with S* in the routing table, which means that the static default route we’ve just configured is a candidate default route (since routers can learn about multiple default routes), and * indicates that this static route is a candidate to become the default route.

Ping will now succeed:

R1#ping 4.2.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms
NOTE
Connected routes always take precedence over static or dynamically discovered routes because they have the administrative distance value of 0 (the lowest possible value). In our case, this means that R1 will send out packets destined for 192.168.0.0/24 according to the specified connected route.
]]>
The ARP table on a Cisco router https://study-ccna.com/the-arp-table-on-a-cisco-router/ Fri, 07 Sep 2018 18:18:09 +0000 https://study-ccna.com/?p=1362 Read More ...]]> Just like regular hosts, if a Cisco router wants to exchange frames with a host in the same subnet, it needs to know its MAC address. The IP-to-MAC address mapping are kept in the router’s ARP table. Consider the following example:

ARP table on a Cisco router example network

R1 has two connected subnets – 10.0.0.0/24 and 172.16.0.0./16. Before exchanging frames with either host, R1 will need to know their MAC addresses. Here is the output of the R1’s ARP table:

R1#show ip arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.0.0.1                -   0060.5C32.7E01  ARPA   GigabitEthernet0/0
Internet  10.0.0.10               6   000C.85CA.AD73  ARPA   GigabitEthernet0/0
Internet  172.16.0.1              -   0060.5C32.7E02  ARPA   GigabitEthernet0/1
Internet  172.16.0.2              10  0001.63DB.1802  ARPA   GigabitEthernet0/1

The ARP table contains two entries for R1’s own two interfaces with the IP address of 10.0.0.1 and 172.16.0.1. The – in the age column indicates that the entry will never be timed out.

The ARP table also lists the MAC addresses of the two connected hosts. Consider the entry for Host A:

Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  10.0.0.10               6   000C.85CA.AD73  ARPA   GigabitEthernet0/0

Here is a brief description of each field:

  • Protocol – the protocol type, almost always Internet
  • Address – the IP address associated with the MAC address, in our case the IP address of Host A
  • Age – by default, an entry will be removed from the ARP table if it wasn’t used in 240 minutes. 6 in this column means that the entry was last used 6 minutes ago. Each time an entry is used, the age will be reset back to zero.
  • Hardware – the MAC address of the host with the corresponding IP address.
  • Type – the type of hardware address. For Ethernet, this value will always be ARPA.
  • Interface – the interface on R1 on which the corresponding host is connected.

 

Here are the steps R1 needs to take before forwarding frames to Host A:

  1. R1 wants to communicate with Host A. R1 checks its routing table. The subnet on which Host A resides is a directly connected subnet.
  2. R1 checks its ARP table to find out whether the Host A’s MAC address is known. If it is not, R1 will send an ARP request to the broadcast MAC address of FF:FF:FF:FF:FF:FF.
  3. Host A receives the frame and sends its MAC address to R1 (ARP reply). The host also updates its own ARP table with the MAC address of the Gigabit0/0 interface on R1.
  4. R1 receives the reply and updates the ARP table with the MAC address of Host A.
  5. Since both hosts now know each other MAC addresses, the communication can occur.
]]>
Uniform Resource Locator (URL) structure https://study-ccna.com/uniform-resource-locator-url-structure/ Fri, 07 Sep 2018 17:57:34 +0000 https://study-ccna.com/?p=1353 Read More ...]]> An URL is a string of characters that contains information about how to fetch a resource from its location. An URL specifies the primary access mechanism and the network location of a resource. A typical URL consists of the following components:

  1. the protocol used to connect to the server (e.g. HTTPS)
  2. the server hostname (e.g. geek-university.com)
  3. the document path (e.g. /course)

 

Here is a graphical representation of these components:

URL structure

URLs can also be used to reference documents other than the web sites. Here are some examples of using URLs to reference an FTP resource, mail address and local files:

  • ftp://www.geek-university.com/uploads.zip – refers to the uploads.zip file on the geek-university.com server that can be accessed using FTP
  • mailto:tuna@geek-university.com – a hyperlink that allows users to to send emails to tuna@geek-university.com using their default email client program.
  • file://C:\images – used to open the C:\images folder on the local computer
]]>
Create a static host route https://study-ccna.com/create-a-static-host-route/ Thu, 06 Sep 2018 19:11:39 +0000 https://study-ccna.com/?p=1349 Read More ...]]> In one of the previous lessons we’ve defined a static route for a specific subnet by using the subnet mask of 255.255.255.0 in the ip route command. IOS also allows you to specify a static host route for a single host by specifying the 255.255.255.255 (/32) subnet mask in the ip route command.

Static host routes are usually used when redundant paths exist. Consider the following example:

Static host route example network

In the example above you can see that we have a network of three routers and a switch connected to the 10.0.0.0/24 subnet. R1 has two paths to reach that subnet – one going through R2, and the other one through R3. Let’s say that we want to use the path going through R2 for all hosts, except the 10.0.0.10/24 host. For that host, we want to use the route going through R3. Here is how this can be done:

R1(config)#ip route 10.0.0.0 255.255.255.0 192.168.0.2
R1(config)#ip route 10.0.0.10 255.255.255.255 172.16.0.2

In the first command we’ve specified R1 to send all packets destined for the 10.0.0.0/24 network to 192.168.0.2 (the IP address of the interface on R2 connected to R1). However, for packets destined for the 10.0.0.10 host, we’ve instructed R1 to send all packets to 172.16.0.2 (the IP address of the interface on R3).

The two routes specified in the ip routes command above overlap (e.g. the IP address 10.0.0.10 is also included in the first command); however, routers always use a more specific route with the longer prefix length. Since /32 is a more specific route than /24, R1 will use the route going through R3 to reach 10.0.0.10.

We can verify that packets are indeed going through desired routes by using the traceroute command on R1:

R1#traceroute 10.0.0.5
Type escape sequence to abort.
Tracing the route to 10.0.0.5

  1   192.168.0.2     0 msec    0 msec    0 msec    
  2   10.0.0.5        0 msec    0 msec    0 msec    
R1#
R1#traceroute 10.0.0.10
Type escape sequence to abort.
Tracing the route to 10.0.0.10

  1   172.16.0.2      0 msec    0 msec    0 msec    
  2   10.0.0.10       0 msec    0 msec    0 msec    

NOTE
The hosts also need to be configured with a correct default gateway – 10.0.0.10 needs to have the IP address of R3 configured as its default gateway, and other hosts on the 10.0.0.0/24 subnet need to have R2 configure as their default gateway.
]]>