Both the physical serial Interfaces on the CGR1000 series routers can be connected to the GOS. By default, the serial interfaces are available to IOS only. However, the IOS can be configured to relay the serial information to to a GOS (emulated) serial interface.
The procedure here shows how to map a serial interface to the GOS:
1. Login to IOS and configure the serial interface as follows:
interface Async1/1
encapsulation relay-line
async mode dedicated
Configure Async1/2 similarly, if required:
interface Async1/2
encapsulation relay-line
async mode dedicated
2. Configure the emulated serial lines between IOS and GOS, and enable relay functionality in IOS.
Configure the following on IOS:
line 1/1
transport preferred none
transport input all
stopbits 1
speed 115200
relay line 1/1 1/5
The above step will bridge the serial traffic from Async1/1 to GOS interface /dev/ttyS1
Configure relay for the second serial port similarly, if required:
line 1/2
transport preferred none
transport input all
stopbits 1
speed 115200
relay line 1/2 1/6
The above step will bridge the serial traffic from Async1/2 to GOS interface /dev/ttyS2
3. Read and write to the serial interface from GOS
Read data in the GOS from the serial interface:
cat /dev/ttyS1
Write data to the serial interface from the GOS:
cat data.txt > /dev/ttyS1
Use /dev/ttyS2 for accessing the second serial port (i.e. virtual serial line 1/6 on IOS)
4. (Optional) Bridge data between serial interfaces from the GOS
Use the following CLIs to enable GOS to bridge data between the serial interfaces:
cat /dev/ttyS1 | tee /dev/ttyS2 &
cat /dev/ttyS2 | tee /dev/ttyS1 &
Hi Anuj,
thanks for this tutorial. What about relaying information from the other interfaces to GoS? Like from WPAN 4/1, or the Fast Ethernet interfaces? We're wanting to do this at the moment.
Thanks,
Chris
Hi Chris,
The GOS has a Layer 3 virtual ethernet connection to Gig0/1 of the IOS. By default, the GOS is configured to request IPv4 DHCP over this virtual interface. IOS can be configured with DHCP server functionality to respond to the GOS DHCP request. . Configuration for the networking between GOS and IOS is described in this document: CGRNetworkConfigGuide.pdf
Similarly, for IPv6 a subnet can be configured in the virtual ethernet link. The Layer 3 routing between CGR interfaces like WPAN4/1, GigabitEthernet, FastEthernet or SVIs and the GOS is performed by the CGR. So effectively, you will have IP connectivity between the GOS and external networks.
Thanks,
Anuj
How can this be done on the C819?
Thanks!
Hi Gregory,
The sample configuration below shows how to connect serial port s0 on C819 to guest for Modbus RTU Client application. (It uses raw-tcp here. You may use others if necessary.)
interface Serial0
physical-layer async
no ip address
encapsulation raw-tcp
!
line 7
raw-socket tcp client 192.168.3.2 32000
where:
• "192.168.3.2" is the host IP address configured in "host ip address" command under IOx submode after you run “show running-config”.
• "32000" is the serial TCP port described in the VM description file (xml from OVA)
Thanks,
Steve