Rosanswers logo

I'm trying to start up communication between two machines running ROS2 Galactic using the examples:

ros2 run demo_nodes_cpp talker


ros2 run demo_nodes_cpp listener
  • Both machines are on the same network,
  • Both machines have multicasting enabled
  • Both machines can ping each other
  • Both machines have the same netmask
  • I have also tried running the examples on different networks with no success
  • Both machines have "export ROS_DOMAIN_ID=30" in their .bashrc

When running the two example nodes on the same machine everything works fine.

Please tell if you need any more info.

Any help would be greatly appreciated!

Originally posted by Jacob G. on ROS Answers with karma: 41 on 2022-03-31

Post score: 1


2 Answers 2


Rosanswers logo

Which RMW implementation do you use?

I got better results with Fast RTPS on 2 AWS instances for connecting nodes and their topics. There is more documentation about its configuration too.

Originally posted by ljaniec with karma: 3064 on 2022-03-31

This answer was NOT ACCEPTED on the original site

Post score: 1


Rosanswers logo

Thanks a lot for the answer! I tried out the different RMWs but nothing seemed to work. Those things didn't fix it for me.

Instead the problem was solved by: 1. Switching to a different network. (I was on a network with extra security layers that might have messed with the communication). 2. The firewall on my two machines were blocking the communication. - As a quick fix you can disable firewall by using the following command:

sudo ufw disable

You can check the status of your firewall do typing:

sudo ufw status

It is not recommended to have your firewall disabled at all times however, so only use this as a way to test if it is the firewall that is the problem.

Originally posted by Jacob G. with karma: 41 on 2022-04-13

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by Sam_Prt on 2022-10-11:
Hello, Is there a way to keep the firewall on and to configure the network to allow the topics to pass ?


Your Answer

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