ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

/etc/network/interfaces configuration for urg node

asked 2015-06-17 00:36:54 -0500

psprox96 gravatar image

Hi guys. I got problem with the network when im using urg_node for Hokuyo Laser Scan.

After running roscore, I start up urg_node with:

rosrun urg_node urg_node _ip_address:=""

However im getting an error that states:

[ERROR] [1434516842.963885543]: Error connecting to Hokuyo: Could not open network Hokuyo:
could not open ethernet port.

I looked this up at Google and many of them said to configure the IP address to

So I edit /etc/network/interfaces with:

sudo nano /etc/network/interfaces

and replace the text with:

auto eth0:0
iface eth0:0 inet static

I tested the urg_node already and it's running.

However, another problem came up. I could not connect to internet. My wifi speed stucked at 1mb/s (using ubuntu now).

I came out with another solution by editing the interfaces file to:

auto eth0
iface eth0 inet dhcp

auto eth0:0
iface eth0:0 inet static

In this case, I can change to use eth0 (able to connect to WIFI but cannot run urg_node) and eth0:0 (cannot connect to WIFI but able to run urg_node) by using this two command:

sudo ifup eth0:0 (Set eth0:0)

sudo ifdown eth0:0 (Return back to eth0)

I was wondering whether there is a way I can combine these two function together, that is able to connect to WIFI and run urg_node.

Thanks for any help!

edit retag flag offensive close merge delete


Hi i have the exact same issue here. I tried your method but it did not help. I'm using a UST 20LX. Any help? Thanks! :)

SQ gravatar image SQ  ( 2016-03-29 03:02:45 -0500 )edit

Hi there! Its been quite some time back since I did this project. However, I hope I can help you. I am using UST-20LX too. First of all, you can actually connect the laser to your computer through wired network. If im not wrong, you cant use internet too.

psprox96 gravatar image psprox96  ( 2016-03-29 10:12:52 -0500 )edit

In order for you to connect to internet, you need to disconnect the wired network and connect to wireless. Thats a bit time consuming so I decided to do the above method. Hokuyo UST-20LX static IP is while my WiFi connection is Therefore it clashes.

psprox96 gravatar image psprox96  ( 2016-03-29 10:15:59 -0500 )edit

Thats why I need to create a new static ip of, leaving aside the wifi connection of May I know your internet connection IP?

psprox96 gravatar image psprox96  ( 2016-03-29 10:58:58 -0500 )edit

Hi thanks for replying! My IP address is for WiFi and for the UST

SQ gravatar image SQ  ( 2016-03-29 21:01:51 -0500 )edit

If you follow this: auto eth0 iface eth0 inet dhcp

auto eth0:0 iface eth0:0 inet static address netmask

there should be no problem.

After setting this network interface, you need to type sudo ifup eth0:0 to use laser and sudo ifdown eth0:0 to use WiFi.

psprox96 gravatar image psprox96  ( 2016-03-29 22:50:22 -0500 )edit

Or is it that you are facing other errors?

psprox96 gravatar image psprox96  ( 2016-03-29 22:50:43 -0500 )edit

Sorry i tried ur method and i got this: Cannot find device "eth0:0" Failed to bring up eth0:0. i realised my eth port is eth3 so i changed it accordingly and i still get the same results

SQ gravatar image SQ  ( 2016-03-30 00:11:16 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2015-06-17 01:04:17 -0500

ahendrix gravatar image

What is the IP address range for your Wifi network?

I suspect you have overlapping IP address ranges for your Hokuyo and your Wifi network.

edit flag offensive delete link more


Hi there! I checked my Wifi's connection information and the IPv4 is My Hokuyo's IP is

psprox96 gravatar image psprox96  ( 2015-06-17 02:22:21 -0500 )edit

Yes, your IP address ranges overlap (both are 192.168.0.X). If you can, try changing the IP address of your Hokuyo and the IP of the eth0:0 interface that you use to connect to it. Maybe use and ?

ahendrix gravatar image ahendrix  ( 2015-06-17 02:27:03 -0500 )edit

Wow i can try that! Thanks for your help!

psprox96 gravatar image psprox96  ( 2015-06-17 02:42:13 -0500 )edit

Hi psprox96. i am also facing same problem. My wifi address is 172.16.x.x and eth0 address is 192.168.x.x but its not working. Could you tell me where am I going wrong?

malgudi gravatar image malgudi  ( 2018-06-19 02:59:57 -0500 )edit

answered 2020-01-24 14:21:53 -0500

fozzy-b gravatar image

Reviving this just because this is still something people need to figure out, & I wrestled with this too.

The connection out for my robot is different than the IP range for the network connection to the Hokuyo, so I needed to edit /etc/network/interfaces to have an eth0 and an eth1 interface. I also needed to keep in mind that the metrics for both interfaces needed to be such that eth0 has a lower metric than eth1. Here is the link to the ubuntu manpage for that file. If you want to view the metric info for your interfaces, then route -n will tell you that.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-06-17 00:36:54 -0500

Seen: 5,301 times

Last updated: Jan 24 '20