Connecting Linux on z/VM to another guest of the same z/VM system

7.1 z/VM guest

A virtual CTCA connection is to be set up between an instance of Linux® on z/VM® and another guest of the same z/VM system.

Assumptions:
  • The guest ID of the peer is guestp.
  • A separate subnet was obtained from the TCP/IP network administrator. The Linux instance uses IP address 10.0.100.100 and the peer uses IP address 10.0.100.101.

Figure 1 illustrates a CTC setup with a peer in the same z/VM.

Figure 1. CTC scenario with peer in the same z/VM

This graphic is explained in the preceding text.

Procedure

  1. Define two virtual channels to your user ID.
    The channels can be defined in the z/VM user directory with directory control SPECIAL statements, for example:
    special f004 ctca
    special f005 ctca
    Alternatively, you can use the CP commands:
    define ctca as f004
    define ctca as f005
  2. Assure that the peer interface is configured.
  3. Connect the virtual channels.
    Assuming that the read channel on the peer corresponds to device number 0xf010 and the write channel to 0xf011 issue:
    couple f004 to guestp f011
    couple f005 to guestp f010
    Be sure that you couple the read channel to the peers write channel and vice versa.
  4. From your booted Linux instance, create a CTCM group device. Issue:
    # echo 0.0.f004,0.0.f005 > /sys/bus/ccwgroup/drivers/ctcm/group
  5. Confirm that the group device is a virtual CTCA device:
    # cat /sys/bus/ccwgroup/drivers/ctcm/0.0.f004/type
    CTC/A
  6. Select a protocol.
    The choice depends on the peer.
    If the peer is ... Choose ...
    Linux 1
    z/OS® 3
    Any other operating system 0
    Assuming that the peer is Linux:
    # echo 1 > /sys/bus/ccwgroup/drivers/ctcm/0.0.f004/protocol
  7. Set the CTCM group device online and find out the assigned interface name:
    # echo 1 > /sys/bus/ccwgroup/drivers/ctcm/0.0.f004/online
    # ls /sys/devices/ctcm/0.0.f004/net/
    ctc1
    In the example, the interface name is ctc1.
  8. Activate the interface locally and on the peer.
    If you are connecting two Linux instances, either can be activated first. If the peer is not Linux, activate the local interface first. To activate the local interface:
    # ip addr add 10.0.100.100 dev ctc1 peer 10.0.100.101
    # ip link set dev ctc1 up
    Be sure that the MTU on both sides of the connection is the same. If necessary, change the default MTU (see Activating and deactivating a CTC interface).
  9. Ensure that the buffer size on both sides of the connection is the same. For the Linux side, see Setting the maximum buffer size if the peer is not Linux, see the operating system documentation of the peer.