Home > Articles > Networking > Routing & Switching

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Basic Settings on a Router (1.1.3)

The basic addressing and configuration of Cisco devices was covered in either the Introduction to Networks or Network Basics course. However, we will spend some time reviewing these topics as well as preparing you for the hands-on lab experience in this course.

Configure Basic Router Settings (1.1.3.1)

Cisco routers and Cisco switches have many similarities. They support a similar modal operating system, similar command structures, and many of the same commands. In addition, both devices have similar initial configuration steps.

When initially configuring a Cisco switch or router, the following steps should be executed:

how.jpg
  • Step 1. Name the device. This changes the router prompt and helps distinguish the device from others.
  • Step 2. Secure management access. Specifically, secure the privileged EXEC, user EXEC, and Telnet access, and encrypt passwords to their highest level.
  • Step 3. Configure a banner. Although optional, this is a recommended step to provide legal notice to anyone attempting to access the device.
  • Step 4. Save the configuration.

For example, the following commands would configure the basic settings for router R1 shown in Figure 1-14.

Figure 1-14

Figure 1-14 Configuring the Basic Settings of R1

Router# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# hostname R1
R1(config)#
R1(config)# enable secret class
R1(config)#
R1(config)# line console 0
R1(config-line)# password cisco
R1(config-line)# login
R1(config-line)# exit
R1(config)#
R1(config)# line vty 0 4
R1(config-line)# password cisco
R1(config-line)# login
R1(config-line)# exit
R1(config)#
R1(config)# service password-encryption
R1(config)#
R1(config)# banner motd $ Authorized Access Only! $
R1(config)# end
R1#
R1# copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
R1#

Configure an IPv4 Router Interface (1.1.3.2)

One distinguishing feature between switches and routers is the type of interfaces supported by each. For example, Layer 2 switches support LANs and, therefore, have multiple FastEthernet or Gigabit Ethernet ports.

Routers support LANs and WANs and can interconnect different types of networks; therefore, they support many types of interfaces. For example, G2 ISRs have one or two integrated Gigabit Ethernet interfaces and High-Speed WAN Interface Card (HWIC) slots to accommodate other types of network interfaces, including serial, DSL, and cable interfaces.

To be available, an interface must be:

  • If using IPv4, configured with an address and a subnet mask: Use the ip address ip-address subnet-mask interface configuration command.
  • Activated: By default, LAN and WAN interfaces are not activated (shutdown). To enable an interface, it must be activated using the no shutdown command. (This is similar to powering on the interface.) The interface must also be connected to another device (a hub, a switch, or another router) for the physical layer to be active.

Optionally, the interface could also be configured with a short description. It is good practice to configure a description on each interface. The description text is limited to 240 characters. On production networks, a description can be helpful in troubleshooting by providing information about the type of network to which the interface is connected. If the interface connects to an ISP or service carrier, it is helpful to enter the third-party connection and contact information.

Depending on the type of interface, additional parameters may be required. For example, in the lab environment, the serial interface connecting to the serial cable end labeled DCE must be configured with the clock rate command.

The steps to configure an IPv4 interface on a router are:

how.jpg
  • Step 1. Add a description. Although optional, it is a necessary component for documenting a network.
  • Step 2. Configure the IPv4 address.
  • Step 3. Configure a clock rate on Serial interfaces. This is only necessary on the DCE device in our lab environment and does not apply to Ethernet interfaces.
  • Step 4. Enable the interface.

For example, the following commands would configure the three directly connected interfaces of router R1 shown in Figure 1-14 (in the previous section):

R1(config)# interface gigabitethernet 0/0
R1(config-if)# description Link to LAN 1
R1(config-if)# ip address 192.168.10.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)#
R1(config)# interface gigabitethernet 0/1
R1(config-if)# description Link to LAN 2
R1(config-if)# ip address 192.168.11.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)#
R1(config)# interface serial 0/0/0
R1(config-if)# description Link to R2
R1(config-if)# ip address 209.165.200.225 255.255.255.252
R1(config-if)# clock rate 128000
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)#

Configure an IPv6 Router Interface (1.1.3.3)

Configuring an IPv6 interface is similar to configuring an interface for IPv4. Most IPv6 configuration and verification commands in the Cisco IOS are very similar to their IPv4 counterparts. In many cases, the only difference uses ipv6 in place of ip in commands.

An IPv6 interface must be:

  • Configured with IPv6 address and subnet mask: Use the ipv6 address ipv6-address/prefix-length [link-local | eui-64] interface configuration command.
  • Activated: The interface must be activated using the no shutdown command.

Unlike IPv4, IPv6 interfaces will typically have more than one IPv6 address. At a minimum, an IPv6 device must have an IPv6 link-local address but will most likely also have an IPv6 global unicast address. IPv6 also supports the ability for an interface to have multiple IPv6 global unicast addresses from the same subnet. The following commands can be used to statically create a global unicast or link-local IPv6 address:

  • ipv6 address ipv6-address/prefix-length: Creates a global unicast IPv6 address as specified.
  • ipv6 address ipv6-address/prefix-length eui-64: Configures a global unicast IPv6 address with an interface identifier (ID) in the low-order 64 bits of the IPv6 address using the EUI-64 process.
  • ipv6 address ipv6-address/prefix-length link-local: Configures a static link-local address on the interface that is used instead of the link-local address that is automatically configured when the global unicast IPv6 address is assigned to the interface or enabled using the ipv6 enable interface command. Recall, the ipv6 enable interface command is used to automatically create an IPv6 link-local address whether or not an IPv6 global unicast address has been assigned.

The steps to configure an IPv6 interface on a router are:

how.jpg
  • Step 1. Add a description. Although optional, it is a necessary component for documenting a network.
  • Step 2. Configure the IPv6 global unicast address. Configuring a global unicast address automatically creates a link-local IPv6 address.
  • Step 3. Configure a link-local unicast address which automatically assigns a link-local IPv6 address and overrides any previously assigned address.
  • Step 4. Configure a clock rate on Serial interfaces. This is only necessary on the DCE device in our lab environment and does not apply to Ethernet interfaces.
  • Step 5. Enable the interface.

In the example topology shown in Figure 1-15, R1 must be configured to support the following IPv6 global network addresses:

  • 2001:0DB8:ACAD:0001:/64 (2001:DB8:ACAD:1::/64)
  • 2001:0DB8:ACAD:0002:/64 (2001:DB8:ACAD:2::/64)
  • 2001:0DB8:ACAD:0003:/64 (2001:DB8:ACAD:3::/64)
Figure 1-15

Figure 1-15 IPv6 Topology

When the router is configured using the ipv6 unicast-routing global configuration command, the router begins sending ICMPv6 Router Advertisement messages out the interface. This enables a PC connected to the interface to automatically configure an IPv6 address and to set a default gateway without needing the services of a DHCPv6 server. Alternatively, a PC connected to the IPv6 network can get its IPv6 address statically assigned, as shown in Figure 1-16. Notice that the default gateway address configured for PC1 is the IPv6 global unicast address of the R1 Gigabit Ethernet 0/0 interface.

Figure 1-16

Figure 1-16 Statically Assign an IPv6 Address to PC1

For example, the following commands would configure the IPv6 global unicast addresses of the three directly connected interfaces of the R1 router shown in Figure 1-15:

R1# configure terminal
R1(config)# interface gigabitethernet 0/0
R1(config-if)# description Link to LAN 1
R1(config-if)# ipv6 address 2001:db8:acad:1::1/64
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)#
R1(config)# interface gigabitethernet 0/1
R1(config-if)# description Link to LAN 2
R1(config-if)# ipv6 address 2001:db8:acad:2::1/64
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)#
R1(config)# interface serial 0/0/0
R1(config-if)# description Link to R2
R1(config-if)# ipv6 address 2001:db8:acad:3::1/64
R1(config-if)# clock rate 128000
R1(config-if)# no shutdown
R1(config-if)#

Configure an IPv4 Loopback Interface (1.1.3.4)

Another common configuration of Cisco IOS routers is enabling a loopback interface.

The loopback interface is a logical interface internal to the router. It is not assigned to a physical port and can therefore never be connected to any other device. It is considered a software interface that is automatically placed in an “up/up” state, as long as the router is functioning.

The loopback interface is useful in testing and managing a Cisco IOS device because it ensures that at least one interface will always be available. For example, it can be used for testing purposes, such as testing internal routing processes, by emulating networks behind the router.

Additionally, the IPv4 address assigned to the loopback interface can be significant to processes on the router that use an interface IPv4 address for identification purposes, such as the Open Shortest Path First (OSPF) routing process. By enabling a loopback interface, the router will use the always available loopback interface address for identification, rather than an IP address assigned to a physical port that may go down.

The steps to configure a loopback interface on a router are:

how.jpg
  • Step 1. Create the loopback interface using the interface loopback number global configuration command.
  • Step 2. Add a description. Although optional, it is a necessary component for documenting a network.
  • Step 3. Configure the IP address.

For example, the following commands configure a loopback interface of the R1 router shown in Figure 1-14 (shown earlier in the chapter):

R1# configure terminal
R1(config)# interface loopback 0
R1(config-if)# ip address 10.0.0.1 255.255.255.0
R1(config-if)# exit
R1(config)#

A loopback interface is always enabled and therefore does not require a no shutdown command. Multiple loopback interfaces can be enabled on a router. The IPv4 address for each loopback interface must be unique and unused by any other interface.

  • + Share This
  • 🔖 Save To Your Account