Using a Cisco router’s AUX port to talk IP

Goal

Setup an AUX port on a Cisco router so we can talk IP over it. This is also called a back-to-back connection.

Cisco router back-to-back connection using the AUX ports

In this example we have two routers, each one has 1 AUX port:

  • R1, a Cisco 2610, which we will assign IP address 10.0.0.1/24
  • R2, a Cisco 1811, which we will assign IP address 10.0.0.2/24

Succes is when we can ping the other router’s IP.

The AUX port is actually an RS-232 port.

Prerequisites

For this configuration you’ll need:

  • Two Cisco routers equipped with an AUX port
  • A rolled cable with 8P8C endpoints. Rolled means the direction of the polarities is reversed on one side. View the pinout  @ Cisco.com. You can use a normal ethernet cable and refit one of the ends (now would be a good time to reuse that cable where you broke the latching tab off).

Caveats

  • If you connect the ports up front (before configuring the routers), the interface might not come up. Disconnecting and then reconnecting should bring it up.
  • Some configuration changes require shutting down (shutdown) and bringing back up (no shutdown) the Async interface, if the interface is already up and running.
  • This example connects the cable at the end.

Configuring router R1

R1 is the Cisco 2610.

Physical settings of the AUX port

Just like the console port, we can modify the configuration of the AUX port using the “line” configuration commands. Here we tell the port in which format bits must be processed, at what speed, etc… Let’s start by defining the operational mode of the AUX port:

! Select the auxiliary port to configure
r1(config)#line aux 0
! Set it up as a modem
r1(config-line)#modem InOut
! Allow all protocols to pass this port
r1(config-line)#transport input all

The default speed setting is 9600 bits per second or 1,2 kilobytes per second. We’re going to increase that to 115 200 bits per second (14,4 kilobytes per second):

r1(config-line)#speed 115200
r1(config-line)#exit
r1(config)#

Verifying our settings:

r1#show line aux 0
   Tty Typ     Tx/Rx    A Modem  Roty AccO AccI   Uses   Noise  Overruns   Int
    65 AUX 115200/115200- inout     -    -    -      0       0     0/0       -

Line 65, Location: "", Type: ""
Length: 24 lines, Width: 80 columns
Baud rate (TX/RX) is 115200/115200, no parity, 2 stopbits, 8 databits
Status: No Exit Banner, Modem Signals Polled
Capabilities: Modem Callout, Modem RI is CD
Modem state: Idle
Modem hardware state: noCTS noDSR  DTR RTS
Special Chars: Escape  Hold  Stop  Start  Disconnect  Activation
                ^^x    none   -     -       none
Timeouts:      Idle EXEC    Idle Session   Modem Answer  Session   Dispatch
               00:10:00        never                        none     not set
                            Idle Session Disconnect Warning
                              never
                            Login-sequence User Response
                             00:00:30
                            Autoselect Initial Wait
                              not set
Modem type is unknown.
Session limit is not set.
Time since activation: never
Editing is enabled.
History is enabled, history size is 20.
DNS resolution in show commands is enabled
Full user help is disabled
Allowed input transports are none.
Allowed output transports are none.
Preferred transport is telnet.
No output characters are padded
No special data dispatching characters
r1#

Note the noCTS and noDSR in the Modem hardware state line. This is because the cable isn’t connected yet. (Or, if it is connected, it’s a bad one).

That’s it for the physical properties of the AUX port. You can play with the settings here to modify how information is electronically being sent and interpreted, but remember to match the settings on the other side too if you do so. Next up is configuring the Async interface that belongs to the AUX port.

Configuring the Async interface

The AUX port A-Synchronous interface overlay, we can find these in Cisco IOS as Async interfaces. However, when configuring Async interfaces, we get to choose from 1 to 65:

r1(config)#interface Async ?
  <1-65>  Async interface number

r1(config)#interface Async

So how do we know which Async interface number corresponds with the AUX port? We can figure this out using the show line command:

r1#show line
   Tty Typ     Tx/Rx    A Modem  Roty AccO AccI   Uses   Noise  Overruns   Int
     0 CTY              -    -      -    -    -      0       0     0/0       -
    65 AUX 115200/115200- inout     -    -    -      0       0     0/0       -
*   66 VTY              -    -      -    -    -      2       0     0/0       -
    67 VTY              -    -      -    -    -      0       0     0/0       -
    68 VTY              -    -      -    -    -      0       0     0/0       -
    69 VTY              -    -      -    -    -      0       0     0/0       -
    70 VTY              -    -      -    -    -      0       0     0/0       -

Line(s) not in async mode -or- with no hardware support:
1-64

r1#

Number 65 here is our AUX port. We’re going to use PPP encapsulation and give it an IP address.

! Select the Async 65 interface
r1(config)#interface Async 65
! Set it up as a dedicated port
r1(config-if)#async mode dedicated
! Encapsulate using the PPP protocol
r1(config-if)#encapsulation ppp
! Assign an IP address
r1(config-if)#ip address 10.0.0.1 255.255.255.0
r1(config-if)#exit
r1(config)#

Verify:

r1#show interface Async 65
Async65 is down, line protocol is down
  Hardware is Async Serial
  Internet address is 10.0.0.1/24
  MTU 1500 bytes, BW 115 Kbit, DLY 100000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation PPP, LCP Closed, loopback not set
  Keepalive not set
  DTR is pulsed for 5 seconds on reset
  Last input 01:00:17, output 01:00:17, output hang never
  Last clearing of "show interface" counters 00:41:12
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: weighted fair
  Output queue: 0/1000/64/0 (size/max total/threshold/drops)
     Conversations  0/1/16 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 86 kilobits/sec
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
r1#

Configuring router R2

R2 is the Cisco 1811.

We don’t need to do anything special here, just mirror and adjust as necessary. Router B will get 10.0.0.2 as IP address.

r2(config)#line aux 0
r2(config-line)#modem InOut
r2(config-line)#transport input all
r2(config-line)#speed 115200
r2(config-line)#exit
r2(config)#do show line
   Tty Typ     Tx/Rx    A Modem  Roty AccO AccI   Uses   Noise  Overruns   Int
*     0 CTY              -    -      -    -    -      0       0     0/0       -
      1 TTY              - inout     -    -    -      0       0     0/0       -
      5 AUX 115200/115200- inout     -    -    -      0       0     0/0       -
      6 VTY              -    -      -    -    -      0       0     0/0       -
      7 VTY              -    -      -    -    -      0       0     0/0       -
      8 VTY              -    -      -    -    -      0       0     0/0       -
      9 VTY              -    -      -    -    -      0       0     0/0       -
     10 VTY              -    -      -    -    -      0       0     0/0       -

Line(s) not in async mode -or- with no hardware support: 
2-4

r3(config)#
r2(config)#interface Async 5
r2(config-if)#async mode dedicated
r2(config-if)#encapsulation ppp
r2(config-if)#ip address 10.0.0.2 255.255.255.0
r2(config-if)#exit
r2(config)#

Bringing up the configuration

Now connect the cable between the AUX ports of the routers. The interface should come up.

Don’t forget: you need a rolled cable.

r1#
*Mar  1 00:12:26.756: %LINK-3-UPDOWN: Interface Async65, changed state to up
*Mar  1 00:12:27.769: %LINEPROTO-5-UPDOWN: Line protocol on Interface Async65, changed state to up
r1#

Now verify operation:

r1#show line aux 0
   Tty Typ     Tx/Rx    A Modem  Roty AccO AccI   Uses   Noise  Overruns   Int
A   65 AUX 115200/115200- inout     -    -    -      2       0     0/49967   -

Line 65, Location: "PPP: 10.0.0.2", Type: ""
Length: 24 lines, Width: 80 columns
Baud rate (TX/RX) is 115200/115200, no parity, 2 stopbits, 8 databits
Status: Ready, Active, No Exit Banner, Async Interface Active
  CTS Raised, Modem Signals Polled
Capabilities: Modem Callout, Modem RI is CD, 
  Line is permanent async interface
Modem state: Ready
Line is running PPP for address 10.0.0.2.
0 output packets queued, 1 input packets.
 Async Escape map is 00000000000000000101000000000000
Modem hardware state: CTS* DSR*  DTR RTS
Special Chars: Escape  Hold  Stop  Start  Disconnect  Activation
                ^^x    none   -     -       none         
Timeouts:      Idle EXEC    Idle Session   Modem Answer  Session   Dispatch
               00:10:00        never                        none     not set
                            Idle Session Disconnect Warning
                              never 
                            Login-sequence User Response
                             00:00:30
                            Autoselect Initial Wait
                              not set 
Modem type is unknown.
Session limit is not set.
Time since activation: 00:03:23
Editing is enabled.
History is enabled, history size is 20.
DNS resolution in show commands is enabled
Full user help is disabled
Allowed input transports are pad v120 telnet rlogin udptn.
Allowed output transports are pad v120 telnet rlogin.
Preferred transport is telnet.
No output characters are padded
No special data dispatching characters
r1#show interface Async 65
Async65 is up, line protocol is up 
  Hardware is Async Serial
  Internet address is 10.0.0.1/24
  MTU 1500 bytes, BW 115 Kbit, DLY 100000 usec, 
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation PPP, LCP Open
  Open: IPCP, loopback not set
  Keepalive not set
  DTR is pulsed for 5 seconds on reset
  Last input 00:02:30, output 00:02:30, output hang never
  Last clearing of "show interface" counters 00:12:52
  Input queue: 1/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: weighted fair
  Output queue: 0/1000/64/0 (size/max total/threshold/drops) 
     Conversations  0/1/32 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 86 kilobits/sec
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     13 packets input, 649 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     13 packets output, 657 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
r1#

That all looks good, now a ping test:

r1#ping 10.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/26/28 ms
r1#

Success! Note the high latency, it goes up if the speed is lower. A 9600 bit/s connection will give you a whopping 120 ms latency (a round-trip of 240 ms!).

Use

Although this is unlikely to ever see production use, it is great for a lab setup:

  • It gives you an extra port on your router.
  • The low bandwidth and high latency can be used to emulate a WAN connection or congestion.

References

Advertisements

Euro Millions lottery outcomes: most drawn numbers

I found out you can download the results from all Euro Millions drawings in a CSV file, which opens a range of statistical analysis tools. Since it’s all about numbers, I’m going to use Excel which is made for this purpose. Let’s start simple: most drawn numbers.

You can get the CSV file here: http://www.euromillions.be/NL/Spelen_en_Winnen/Trekkingsspelen/Euromillions/Results/DownloadResults.aspx

Thanks to Bart Devriendt for fixing this up (see comments).

The rules

Euro Millions is a simple lottery, let’s quickly go over how it works:

  • There are two bowls which numbers are drawn from.
  • 5 numbers are drawn from bowl A with a range from 1 to 50.
  • 2 numbers are drawn from bowl B with a range from 1 to 11 which are called “Stars”.
  • Once a number has been drawn from a bowl it cannot be redrawn.
  • You can participate multiple times on the same drawing.

The two Euro Millions bowls.

When do you get a prize?

You need at least two matching numbers to “win”. The more numbers you match, the higher the prize. If you’ve played one set of numbers, and you have two matching numbers, you’ll usually profit. (From the drawing of 31/08/2012, if you had 2 matching numbers, you earned € 4,20 while it costs € 2,- to participate).

The jackpot currently starts at € 15 000 000 and whatever is left carries over to the next drawing.

The form you fill in to participate. They elusively present two rows to fill in but you only have to fill in one to join the game.

Stat. analysis 101: which numbers are most drawn?

(This analysis has been done based on the results from 13/02/2004 to 31/08/2012)

The Excel sheet: Euro Millions – Most drawn numbers

Since we know which numbers have been drawn, we can make a frequency table. The tables below are sorted on their frequency.

Regulars

32 39
33 43
39 44
46 45
2 45
13 45
27 45
43 45
18 46
10 46
28 47
34 47
48 47
41 47
31 47
5 48
40 48
7 48
47 48
35 49
42 49
8 49
30 50
20 50
22 50
6 50
24 50
26 52
3 52
15 52
17 53
44 53
45 53
29 53
49 53
23 54
9 55
16 56
25 57
1 57
21 58
36 58
37 58
11 58
14 60
38 60
19 63
12 63
4 63
50 72

Stars

10 27
11 29
4 90
6 104
2 106
9 107
1 108
7 111
8 115
5 115
3 120

Graphs

What are the most drawn numbers?

4, 12, 14, 19, 38 (tied with 14), 50; stars: 3, 5 (tied with 8)

What’s next?

Do you know any more interesting statistics we could get out of this?