Networking Blog
Open/Close

IPv6 router interfaces and RIPng configuration

November 18th, 2007 by RaDoc

The big issues about IPv6 coming and replacing IPv4 are left behind. This not so short article describes how the IPv6 should be configured on Cisco routers. I used Dynamips for testing. If you are interested, you can verify on your own everything that is written here. The configuration file for Dynamips is the following:

# Simple lab - IPv6 router interfaces and RIPng configuration

[localhost]

[[7200]]
image = c:\Program Files\Dynamips\images\c7200-js-mz.122-11.T.image
#you should personalize this first line and enter the path to your Cisco image
# On Linux / Unix use forward slashes:
# image = /opt/7200-images/c7200-jk9o3s-mz.124-7a.image
npe = npe-400
ram = 96
idlepc = 0x60662668
#you should change this too (check the tutorial on their site to find out how to determine the idlepc)

[[ROUTER R1]]
model = 7200

[[router R2]]
s1/0 = R1 s1/1
s1/1 = R3 s1/0
model = 7200
[[router R3]]
model = 7200

After initializing the network we’re ready to begin. First we have some hard work to do. We have to put IPv6 addresses on each interface involved in this small configuration. I often hate to do this because I did it so many times that I’m sick of it. But that’s life!
First we have router R1:


Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router1
Router1(config)#int s1/1
Router1(config-if)#ipv6 add 2002:cccc:0:1::1/64
Router1(config-if)#clock rate 128000
Router1(config-if)#no shut
Router1(config-if)#
*Nov 18 13:28:00.383: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
*Nov 18 13:28:01.387: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1,
changed state to up
Router1(config-if)#int loopback 0
Router1(config-if)#ipv6 add 2002:cccc:0:11::1/64
Router1(config-if)#end
Router1#sh ipv6 int brief
FastEthernet0/0 [administratively down/down]
unassigned
Serial1/0 [administratively down/down]
unassigned
Serial1/1 [up/down]
FE80::C800:2FF:FEC4:0
Serial1/2 [administratively down/down]
unassigned
Serial1/3 [administratively down/down]
unassigned
Serial1/4 [administratively down/down]
unassigned
Serial1/5 [administratively down/down]
unassigned
Serial1/6 [administratively down/down]
unassigned
Serial1/7 [administratively down/down]
unassigned
Loopback0 [up/up]
2002:CCCC:0:11::1

Then router R2 with a similar configuration.


Router>enable
Router#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router2
Router2(config)#int s1/0
Router2(config-if)#ipv6 add 2002:cccc:0:1::2/64
Router2(config-if)#clock rate 128000
Router2(config-if)#no shut
Router2(config-if)#
*Nov 18 13:36:25.279: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up1/1
*Nov 18 13:36:26.283: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
changed state to up
Router2(config-if)#int s1/1
Router2(config-if)#ipv6 add 2001:cccc:0:2::1/64
Router2(config-if)#clock rate 128000
Router2(config-if)#no shut
Router2(config-if)#
*Nov 18 13:37:22.459: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
*Nov 18 13:37:23.463: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1,
changed state to up
*Nov 18 13:37:45.043: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1,
changed state to down
Router2(config-if)#int loopback 0
Router2(config-if)#
Router2(config-if)#ip add 2002:cccc:0:12::1/64
Router2(config-if)#exit
Router2#sh ipv6 int br
*Nov 18 13:46:17.883: %SYS-5-CONFIG_I: Configured from console by console
FastEthernet0/0 [administratively down/down]
unassigned
Serial1/0 [up/up]
2002:CCCC:0:1::2
Serial1/1 [up/up]
2002:CCCC:0:2::1
Serial1/2 [administratively down/down]
unassigned
Serial1/3 [administratively down/down]
unassigned
Serial1/4 [administratively down/down]
unassigned
Serial1/5 [administratively down/down]
unassigned
Serial1/6 [administratively down/down]
unassigned
Serial1/7 [administratively down/down]
unassigned
Loopback0 [up/up]
2002:CCCC:0:12::1
Raouter2#

And finally router R3.


Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router3
Router3(config)#int s1/0
Router3(config-if)#ipv6 add 2001:cccc:0:2::2/64
Router3(config-if)#clock rate 128000
Router3(config-if)#no shut
Router3(config-if)#exit
*Nov 18 13:43:08.283: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Nov 18 13:43:09.287: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
changed state to up
Router3(config)#int loopback 0
Router3(config-if)#ipv6 add 2002:cccc:0:13::1/64
Router3(config-if)#end
Router3#
*Nov 18 13:43:57.735: %SYS-5-CONFIG_I: Configured from console by console
Router3#sh ipv6 int b
FastEthernet0/0 [administratively down/down]
unassigned
Serial1/0 [up/up]
2001:CCCC:0:2::2
Serial1/1 [administratively down/down]
unassigned
Serial1/2 [administratively down/down]
unassigned
Serial1/3 [administratively down/down]
unassigned
Serial1/4 [administratively down/down]
unassigned
Serial1/5 [administratively down/down]
unassigned
Serial1/6 [administratively down/down]
unassigned
Serial1/7 [administratively down/down]
unassigned
Loopback0 [up/up]
2002:CCCC:0:13::1

This should do it. I mention here there might be some slight changes in the code listed here. The problem is I often make mistakes when I write the commands in CLI and the screen looks pretty messy. That’s why I decided to make some cuts and then copy/paste it here.

Let’s test the mtf! :p


Router3#ping 2001:cccc:0:2::1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:CCCC:0:2::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/86/156 ms
Router3#ping 2001:cccc:0:1::2

% No valid source address for destination

UPS!! The first ping went ok, but the second one didn’t. Let’s see why.


Router3#sh ipv6 route
IPv6 Routing Table - 6 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
Timers: Uptime/Expires

L 2001:CCCC:0:2::2/128 [0/0]
via ::, Serial1/0, 00:13:02/never
C 2001:CCCC:0:2::/64 [0/0]
via ::, Serial1/0, 00:13:05/never
L 2002:CCCC:0:13::1/128 [0/0]
via ::, Loopback0, 00:12:19/never
C 2002:CCCC:0:13::/64 [0/0]
via ::, Loopback0, 00:12:19/never
L FE80::/10 [0/0]
via ::, Null0, 00:14:22/never
L FF00::/8 [0/0]
via ::, Null0, 00:14:22/never

Now we know why. There is no route in the IPv6 routing table to the destination network. There are more possibilities. The first and the simplest one is to make a static route to the destination network. This is applicable here but what happens if we have bigger networks? We implement the second possibility: a routing protocol. In our case we will implement RIPng (RIP next generation)

RIPng configuration is a little bit different from the RIP configuration we know. Why is it different? We’ll see in a few moments. First we have to enable IPv6 routing on our three routers.


Router1(config)#ipv6 unicast-routing -->activate ipv6 routing
Router2(config)#ipv6 unicast-routing
Router3(config)#ipv6 unicast-routing

Then we get to work. We first start the instance NetworkingBlog of the RIPng. Here comes the difference I was writing about earlier. The interfaces that we want to include in the RIPng updates are not specified within the Router1(config-rtr) prompt. We have to go to each interface and activate/enable it. We have the three router exhibits below.


Router1(config)#ipv6 router rip NetworkingBlog
Router1(config-rtr)#exit
Router1(config)#int s1/1
Router1(config-if)#ipv6 rip NetworkingBlog enable
Router1(config-if)#int loopback 0
Router1(config-if)#ipv6 rip NetworkingBlog enable
Router1(config-if)#end

Router2(config)#ipv6 router rip NetworkingBlog
Router2(config-rtr)#exit
Router2(config)#int s1/0
Router2(config-if)#ipv6 rip NetworkingBlog enable
Router2(config-if)#int s1/1
Router2(config-if)#ipv6 rip NetworkingBlog enable
Router2(config-if)#int loopback 0
Router2(config-if)#ipv6 rip NetworkingBlog enable
Router2(config-if)#end
Router2#

Router3(config)#ipv6 router rip NetworkingBlog
Router3(config-rtr)#exit
Router3(config)#int s1/0
Router3(config-if)#ipv6 rip NetworkingBlog enable
Router3(config)#int loopback 0
Router3(config-if)#ipv6 rip NetworkingBlog enable
Router3(config-if)#end
Router3#

After this whole mess, we check the routing table again. Look’s like some things have changed. Or should I better say some things appeared in the routing table. The routes on the lines that begin with an ‘R’ are routes learned by mister RIPng and taken to the routing table.


Router1#sh ipv6 route
IPv6 Routing Table - 10 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
Timers: Uptime/Expires

R 2001:CCCC:0:2::/64 [120/2]
via FE80::C801:2FF:FEC4:0, Serial1/1, 00:03:28/00:02:43
L 2002:CCCC:0:1::1/128 [0/0]
via ::, Serial1/1, 00:37:17/never
C 2002:CCCC:0:1::/64 [0/0]
via ::, Serial1/1, 00:37:20/never
R 2002:CCCC:0:2::/64 [120/2]
via FE80::C801:2FF:FEC4:0, Serial1/1, 00:03:28/00:02:43
L 2002:CCCC:0:11::1/128 [0/0]
via ::, Loopback0, 00:44:46/never
C 2002:CCCC:0:11::/64 [0/0]
via ::, Loopback0, 00:44:46/never
R 2002:CCCC:0:12::/64 [120/2]
via FE80::C801:2FF:FEC4:0, Serial1/1, 00:03:03/00:02:43
R 2002:CCCC:0:13::/64 [120/3]
via FE80::C801:2FF:FEC4:0, Serial1/1, 00:03:22/00:02:42
L FE80::/10 [0/0]
via ::, Null0, 00:46:26/never
L FF00::/8 [0/0]
via ::, Null0, 00:46:30/never
Router1#

Router2#sh ipv6 route
IPv6 Routing Table - 12 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
Timers: Uptime/Expires

L 2001:CCCC:0:2::1/128 [0/0]
via ::, Serial1/1, 00:31:59/never
C 2001:CCCC:0:2::/64 [0/0]
via ::, Serial1/1, 00:32:02/never
L 2002:CCCC:0:1::2/128 [0/0]
via ::, Serial1/0, 00:40:49/never
C 2002:CCCC:0:1::/64 [0/0]
via ::, Serial1/0, 00:40:52/never
L 2002:CCCC:0:2::1/128 [0/0]
via ::, Serial1/1, 00:31:59/never
C 2002:CCCC:0:2::/64 [0/0]
via ::, Serial1/1, 00:32:02/never
R 2002:CCCC:0:11::/64 [120/2]
via FE80::C800:2FF:FEC4:0, Serial1/0, 00:04:56/00:02:47
L 2002:CCCC:0:12::1/128 [0/0]
via ::, Loopback0, 00:38:42/never
C 2002:CCCC:0:12::/64 [0/0]
via ::, Loopback0, 00:38:42/never
R 2002:CCCC:0:13::/64 [120/2]
via FE80::C802:2FF:FEC4:0, Serial1/1, 00:04:56/00:02:26
L FE80::/10 [0/0]
via ::, Null0, 00:41:17/never
L FF00::/8 [0/0]
via ::, Null0, 00:41:17/never
Router2#

We should try the ping command that didn’t work earlier. It should work perfectly fine this time. As you can see we included the loopback interfaces as well in the routing updates by enabling the NetworkingBlog RIPng process. They also appear in the routing tables.

Problems with any command above? Found this post useful? Take the keyboard and kick some comments in here. Any feedback is highly appreciated.

Managing packages in Ubuntu/Debian

November 11th, 2007 by RaDoc

Manual management of a Linux based system became very difficult at a point so the need of special types of packages was a great challenge. Nowadays, we have some types that are the most relevant.

  • RPM packages - were introduced by RedHat and are known to be the most popular binary format. But RedHat is not the only distribution that uses RPMs. Suse and Mandrake are also using it.
  • DEB packages - Debian binaries. There are a lot of distributions that use this kind of format, but the most known oes are Ubuntu, Knoppix, Linspire and Xandros.
  • TGZ packages - this is the least spread type of binaries. The only important distribution that uses it is Slackware.

There are also more types but we resume only to these three for the moment. For general information on Linux distribution read this.

The question that I’ve been asked lately by students of mine was about repositories. What is a repository? Well a repository can be assimilated with a huge storage facility where a lot of software is stored for people to come and serve themselves. In Ubuntu we have a file called /etc/apt/sources.list that holds URLs to DEB repositories, meaning to repositories where packages are stored in DEB format. Let’s have a better look and feel. Let’s install the telnet server on an Ubuntu system. Is it hard? I don’t know. Let’s see:

# apt-cache search telnet
# apt-get install telnetd

Hm! Not hard at all. The first command searches a package that contains telnet. The second installs the package telnetd to the system. What happens if the package we are looking for is not found? (For example Thunderbird 2) The first way to solve this problem is to add a repository to the list.

deb http://ubuntu.iuculano.it feisty thunderbird
deb-src http://ubuntu.iuculano.it feisty thunderbird

What needs to be done now is to update the list, search the package again and install it.

# apt-get update
# apt-cache search thunderbird
# apt-get install mozilla-thunderbird

There are also ways to remove packages from your system (what comes up must go down).

# apt-get remove package_name
# apt-get -purge remove package_name

The difference between the two is that the second also removes the configuration files. Let’s suppose that I don’t want a package removed but I’d like it upgraded. First I have to check if there are new versions with the command upgrade:

# apt-get upgrade

If you are a beginner in using Linux and stuff related to it, this is a simple way of managing packages in a Debian-like environment. For questions related to this post check the comment and get involved.

Router Telnet’ing HowTo

May 8th, 2007 by RaDoc

The biggest problems you encounter when you desing or maintain a network are related to connection problems. If there are problems, solutions must exist. And they do. At layer 3 (OSI Stack) we have the ‘ping’ protocol that verifies if we have end to end connectivity. Telnet (layer 7) can be a similar tool, but we can do much more with it. As you probably know we use Telnet for connections to remote stations/hosts.

To configure routers, is always easier to put them in a rack, configure their vty lines and then go to headquarters, office, or home and continue to configure them to do their jobs as you wish. In this HowTo post we will practice Telnet’ing from one router to another. We will suspend Telnet sessions using the ctrl-shift-6 X sequence and display active Telnet sessions using
the show sessions and show users commands. So let’s begin. Continue reading ‘Router Telnet’ing HowTo’

Short tutorial on CDP

May 8th, 2007 by RaDoc

What is CDP? … Cisco Discovery Protocol. In fact, CDP is a Cisco proprietary protocol which allows Cisco routers to discover themselves in a network. How it works? The simplest explanation is that a router uses this protocol when it initiates an interface and discovers if the host linked through that interface is a Cisco machine or not. This way a router can find out about its directly connected neighbors without configuring an IP address on interfaces.

To view a router’s neighbors just type in the command:
router1# sh cdp neighbors

For a detailed information on Cisco hosts directly connected one of the following commands should do the job:
router1# show cdp neighbors detail
router1# show cdp entry *

The CDP starts at bootup. There are a few parameters that can be modified in order to personalize the work of CDP. For example if you want, you can change the time between two CDP advertisments. These advertisments are sent on running interfaces to achieve the goals of Cisco Discovery Protocol: discovering Cisco neighbors. In the example below we change the CDP advertisement interval to 50 sec. and the holdtime interval to 170 sec and then we issue the show cdp interface to see the results.
router1(config)# cdp timer 50
router1(config)# cdp holdtime 170
router1(config)# exit
router1# sh cdp interface

Try these commands with your simulator and see the results.

Begginer Tips - Top 5 begginer mistakes in router configuration

May 3rd, 2007 by RaDoc

Many colleagues of mine made some mistakes when learning to configure Cisco routers (me toooo!!). :) What where these big mistakes? Well, they where mistakes, not huge, but big enough to make a router vulnerable to attacks or even to force the interfaces not to work properly.

1. The first mistake in today’s top 5 is forgetting to configure the clockrate on a serial point-to-point interface. Yap!! We somtetimes spent over two hours in the lab to debug. Such a simple mistake is probably easy to localize if you have a little experience in working with routers.

router1(config)# int serial0
router1(config-if)# ip address 175.10.1.1 255.255.255.0

router1(config-if)# clockrate 128000
router1(config-if)# no shut


How to localize the problem? Most of the times the biggest sign that this mistake was made is the fact that the Serial line is up (meaning that physical contact is ok) but Line protocol is down. Continue reading ‘Begginer Tips - Top 5 begginer mistakes in router configuration’