0
$\begingroup$

Rosanswers logo

Hello,

I am trying to share a topic between two different networks.

There are three computers and let's call them as PC1,PC2, and PC3. (all are ubuntu and running ROS)

Each PC has the following network settings.

PC1:

wlan0 (obtaining IP from ISP's DHCP) IP: 121.131.88.99

eth0 IP: 192.168.1.1

PC2: eth0 (Static IP address) IP: 192.168.1.30 Gateway: 192.169.1.1

PC3: wlan0 (obtaining IP from ISP's DHCP) IP: 121.131.88.100

For more explanations, I have two network adaptors named: wlan0 and eth0 on PC1.

wlan0 connects to ISP's network (the Internet is connected) and obtain a IP address through ISP's DHCP. (let's say 121.131.88.99)

eth0 is a gateway that has a static IP address (192.168.1.1) and PC2 is connected to PC1 through wired for the Internet sharing. (It works). iptable is properly set up for forwarding from wlan0 to eth0.

ROS master is running on PC2 which has a IP address (192.168.1.30). This machine publish a simple topic such as "/test/topic" with std_msgs/String type.

What I want is that subscribing the topic "/test/topic" from PC3. I can subscribe the topic on PC2 by setting ROS_MASTER_URI to 192.168.1.30 but PC3 can't connect to PC2 since they are belongs to different networks. (192.169.x.x) and (121.131.x.x).

I already attempted ros multimaster_fkie but still couldn't subscribe anything on PC3.

I think I do need some iptable settings from eth0 to wlan0 on PC1 as it done for the Internet sharing (from wlan0 to to eth0).

Any comments on this issue would be appreciate.

Cheers.

PS: I am bit afraid whether the explanation is understandable or deliver my point or not as my network setting environments is messy.


Originally posted by enddl22 on ROS Answers with karma: 177 on 2014-09-04

Post score: 0


Original comments

Comment by bvbdort on 2014-09-05:
did you set ROS_IP ?

Comment by enddl22 on 2014-09-05:
Yes, but no success.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

ROS does not cross NAT firewalls. You should probably run one ROS master on each network and try to set up some kind of topic forwarding between them.


Originally posted by ahendrix with karma: 47576 on 2014-09-05

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by enddl22 on 2014-09-05:
Thanks for the comment. Do you know any reference for topic forwarding? I guess you refer to packet forwarding using "iptables". I attempted to forward all packet from PC2 to PC3 by setup iptables rules on PC1. It is possible to send a message using netcat but roscore running on PC3 can't subscirbe.

Comment by DufeRob on 2017-05-19:
Hello. I ran into the same problem. Have you solved this?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.