Direct connection of two routers connecting through serial interfaces (two address mappings)

Network requirements

As shown in Figure 137, two routers are connected directly; IP packets can be transmitted between serial interfaces over the X.25 link layer protocol. Two IP to X.121 mappings are available on Router A.

Figure 137: Network diagram

Configuration procedure

  1. Configure Router A:

    # Enter interface view.

    <RouterA> system-view
    [RouterA] interface serial 2/0
    

    # Assign an IP address for the interface.

    [RouterA-Serial2/0] ip address 202.38.160.1 255.255.255.0
    

    # Configure the link layer protocol as X.25 and the interface to operate in DTE mode.

    [RouterA-Serial2/0] link-protocol x25 dte
    

    # Assign an X.121 address for the interface.

    [RouterA-Serial2/0] x25 x121-address 20112451
    

    # Configure address mappings to the peer.

    [RouterA-Serial2/0] x25 map ip 202.38.161.2 x121-address 20112452
    [RouterA-Serial2/0] x25 map ip 202.38.160.2 x121-address 20112452
    

    # Configure the maximum packet size allowed and the window size.

    [RouterA-Serial2/0] x25 packet-size 1024 1024
    [RouterA-Serial2/0] x25 window-size 5 5
    [RouterA-Serial2/0] shutdown
    [RouterA-Serial2/0] undo shutdown
    
  2. Configure Router B:

    # Enter interface view.

    <RouterB> system-view
    [RouterB] interface serial 2/0
    

    # Assign an IP address to the interface.

    [RouterB-Serial2/0] ip address 202.38.160.2 255.255.255.0
    

    # Configure the link layer protocol of the interface as X.25 and specify the interface to operate in DCE mode.

    [RouterB-Serial2/0] link-protocol x25 dce
    

    # Assign an X.121 address for the interface.

    [RouterB-Serial2/0] x25 x121-address 20112452
    

    # Configure an address mapping to the peer.

    [RouterB-Serial2/0] x25 map ip 202.38.160.1 x121-address 20112451
    

    # Configure the maximum packet size allowed and the window size.

    [RouterB-Serial2/0] x25 packet-size 1024 1024
    [RouterB-Serial2/0] x25 window-size 5 5
    [RouterB-Serial2/0] shutdown
    [RouterB-Serial2/0] undo shutdown
    

    # Because the peer (Router A) has two IP addresses corresponding to the X.121 address at the local end (Router B) and the local IP address is not in the first mapping, two virtual circuits will be created when connection is being established. Specify the maximum number of virtual circuits in the mapping as 2.

    [RouterB-Serial2/0] x25 vc-per-map 2
    

Verifying the configuration

The virtual circuit configured in this example is an SVC. The routers establish it only when they must communicate.

# Ping Router B from Router A.

[RouterA-Serial2/0] ping 202.38.160.2
  PING 202.38.160.2: 56  data bytes, press CTRL_C to break
    Reply from 202.38.160.2: bytes=56 Sequence=1 ttl=255 time=33 ms
    Reply from 202.38.160.2: bytes=56 Sequence=2 ttl=255 time=26 ms
    Reply from 202.38.160.2: bytes=56 Sequence=3 ttl=255 time=27 ms
    Reply from 202.38.160.2: bytes=56 Sequence=4 ttl=255 time=26 ms
    Reply from 202.38.160.2: bytes=56 Sequence=5 ttl=255 time=26 ms

  --- 202.38.160.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 26/27/33 ms

The output shows that the SVC has been established between the two routers.

# Display the X.25 address mapping table of Router A.

[RouterA-Serial2/0] display x25 map
  Interface: Serial2/0(protocol status is UP)
    ip 202.38.160.2  X.121 address:20112452
      Map-type: SVC_MAP  VC-number: 1
      Facility:
    ip 202.38.161.2  X.121 address:20112452
      Map-type: SVC_MAP  VC-number: 0
      Facility:

# Display the X.25 virtual circuit information of Router A.

[RouterA-Serial2/0] display x25 vc
Interface: Serial2/0
  SVC 1024
    State: P4(transmit)
    Map: ip 202.38.160.2 to 20112452
    Window size: input 5  output 5
    Packet Size: input 1024  output 1024
    Local PS: 5  Local PR: 5  Remote PS: 4  Remote PR: 5
    Local Busy: FALSE  Reset times: 0
    Input/Output:
      DATA 5/5  INTERRUPT 0/0
      RR 0/0  RNR 0/0  REJ 0/0
      Bytes 420/420
    Send Queue(Current/Max): 0/200