'How to configure Cyclone DDS to work with NAT?

I have 2 computers in the robot:

  • PC_1 - has 4 eth interfaces and 1 wifi. The 2 eth ports are bridged - a network for second computer and other robot network devices such as scanners. The computer does not have a strong enough GPU - therefore it needs an additional computer for image processing (PC_2).

  • PC_2 (vision system) - has 1 eth interface and is connected to one of the PC_1 bridge ports.

PC_2 can access the Internet through the router by using NAT (MASQUERADE):

Ip tables rules on PC_1:

*nat
:PREROUTING ACCEPT [1779:281617]
:INPUT ACCEPT [493:88792]
:OUTPUT ACCEPT [719:119062]
:POSTROUTING ACCEPT [359:69444]
:DOCKER - [0:0]
-A PREROUTING -i wlp2s0 -p tcp -m tcp --dport 1111 -j DNAT --to-destination 172.17.10.253:22
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
-A POSTROUTING -s 172.18.0.0/16 ! -o docker0 -j MASQUERADE
-A POSTROUTING -o wlp2s0 -j MASQUERADE
-A DOCKER -i docker0 -j RETURN

*filter
:INPUT ACCEPT [33647:5742162]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [29913:8994379]
:DOCKER - [0:0]
:DOCKER-ISOLATION-STAGE-1 - [0:0]
:DOCKER-ISOLATION-STAGE-2 - [0:0]
:DOCKER-USER - [0:0]
-A FORWARD -j DOCKER-USER
-A FORWARD -j DOCKER-ISOLATION-STAGE-1
-A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -o docker0 -j DOCKER
-A FORWARD -i docker0 ! -o docker0 -j ACCEPT
-A FORWARD -i docker0 -o docker0 -j ACCEPT
-A FORWARD -s 172.17.0.0/16 -i enp1s0f0 -o wlp2s0 -m conntrack --ctstate NEW -j ACCEPT
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A DOCKER-ISOLATION-STAGE-1 -i docker0 ! -o docker0 -j DOCKER-ISOLATION-STAGE-2
-A DOCKER-ISOLATION-STAGE-1 -j RETURN
-A DOCKER-ISOLATION-STAGE-2 -o docker0 -j DROP
-A DOCKER-ISOLATION-STAGE-2 -j RETURN
-A DOCKER-USER -j ACCEPT
-A DOCKER-USER -j RETURN

Network:

enter image description here

I can communicate via dds PC_1 with PC_2 and PC_1 with a laptop.But I can't get data from PC_2 on my laptop

By connecting my laptop with a wifi router, I would like to receive data from PC_2 (image) using Cyclone DDS.

I am not sure which part of the system needs to be reconfigured: iptalbes rules, multicast forwarding or cyclonedds.xml?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source