ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    IP Routing, allowing device from usb0 to communicate with device on eth0

    VOXL 2
    2
    3
    296
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • John NomikosJ
      John Nomikos
      last edited by

      Good afternoon,

      For the past few days, I have been running around in circles trying to make it so my computer with a microhard can ping a device connected to the voxl2 via Ethernet.

      Essentially, I have a camera connected to the VOXL2 via Ethernet and the microhard is on usb0. This camera hosts it's own rtsp stream, and does not need to be streamed from the voxl2. From my host computer, I want to be able to connect to the camera connected to the voxl2 and directly ping it's IP. I know to do this, I need to have the VOXL2 route from usb0 to eth0 in some way to make it so when the GCS pings the camera's ip, it goes through the usb0 interface to eth0.

      I am pretty new overall to networking, so please correct me if my idea is wrong.

      bond0: flags=5123<UP,BROADCAST,MASTER,MULTICAST>  mtu 1500
              ether 0e:ae:7a:d3:cb:54  txqueuelen 1000  (Ethernet)
              RX packets 0  bytes 0 (0.0 B)
              RX errors 0  dropped 0  overruns 0  frame 0
              TX packets 0  bytes 0 (0.0 B)
              TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
      
      dummy0: flags=195<UP,BROADCAST,RUNNING,NOARP>  mtu 1500
              inet6 fe80::aee5:90ba:7fd5:a0ed  prefixlen 64  scopeid 0x20<link>
              ether f2:fa:36:1f:17:83  txqueuelen 1000  (Ethernet)
              RX packets 0  bytes 0 (0.0 B)
              RX errors 0  dropped 0  overruns 0  frame 0
              TX packets 49  bytes 15670 (15.6 KB)
              TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
      
      eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
              inet 192.168.144.21  netmask 255.255.255.0  broadcast 192.168.144.255
              ether 5c:85:7e:3e:94:33  txqueuelen 1000  (Ethernet)
              RX packets 2577  bytes 154620 (154.6 KB)
              RX errors 0  dropped 0  overruns 0  frame 0
              TX packets 83  bytes 21341 (21.3 KB)
              TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
      
      lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
              inet 127.0.0.1  netmask 255.0.0.0
              inet6 ::1  prefixlen 128  scopeid 0x10<host>
              loop  txqueuelen 1000  (Local Loopback)
              RX packets 95  bytes 8224 (8.2 KB)
              RX errors 0  dropped 0  overruns 0  frame 0
              TX packets 95  bytes 8224 (8.2 KB)
              TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
      
      usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
              inet 192.168.168.100  netmask 255.255.255.0  broadcast 192.168.168.255
              inet6 fe80::3b33:ef4a:4410:1470  prefixlen 64  scopeid 0x20<link>
              ether 96:dc:72:9d:a5:01  txqueuelen 1000  (Ethernet)
              RX packets 5661  bytes 324594 (324.5 KB)
              RX errors 0  dropped 0  overruns 0  frame 0
              TX packets 3874  bytes 456769 (456.7 KB)
              TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
      

      The first thing I did was enable forwarding on the VOXL2 by uncommenting this line on /etc/sysctl.conf
      net.ipv4.ip_forward=1

      Then I tried pinging the device from my home computer while connected via microhard.

      From my home computer:
      I was able to ping 192.168.168.100, which is expected since that is the microhard.
      I was able to ping 192.168.144.21 which is the eth0 interface.
      However, I have been unable to ping 192.168.144.52, which is the address of the camera, despite being able to ping it successfully on the VOXL2.

      john@john-desktop:~$ ping -R 192.168.168.100
      PING 192.168.168.100 (192.168.168.100) 56(124) bytes of data.
      64 bytes from 192.168.168.100: icmp_seq=1 ttl=64 time=3.06 ms
      RR: 	192.168.168.146
      	192.168.168.100
      	192.168.168.100
      	192.168.168.146
      
      64 bytes from 192.168.168.100: icmp_seq=2 ttl=64 time=3.59 ms	(same route)
      64 bytes from 192.168.168.100: icmp_seq=3 ttl=64 time=2.68 ms	(same route)
      64 bytes from 192.168.168.100: icmp_seq=4 ttl=64 time=3.31 ms	(same route)
      ^C
      --- 192.168.168.100 ping statistics ---
      4 packets transmitted, 4 received, 0% packet loss, time 3004ms
      rtt min/avg/max/mdev = 2.680/3.159/3.585/0.332 ms
      john@john-desktop:~$ ping -R 192.168.144.21
      PING 192.168.144.21 (192.168.144.21) 56(124) bytes of data.
      64 bytes from 192.168.144.21: icmp_seq=1 ttl=64 time=3.14 ms
      RR: 	192.168.168.150
      	192.168.144.21
      	192.168.144.21
      	192.168.168.150
      
      64 bytes from 192.168.144.21: icmp_seq=2 ttl=64 time=2.81 ms	(same route)
      64 bytes from 192.168.144.21: icmp_seq=3 ttl=64 time=2.99 ms	(same route)
      64 bytes from 192.168.144.21: icmp_seq=4 ttl=64 time=2.84 ms	(same route)
      64 bytes from 192.168.144.21: icmp_seq=5 ttl=64 time=2.85 ms	(same route)
      64 bytes from 192.168.144.21: icmp_seq=6 ttl=64 time=2.77 ms	(same route)
      ^C
      --- 192.168.144.21 ping statistics ---
      6 packets transmitted, 6 received, 0% packet loss, time 5009ms
      rtt min/avg/max/mdev = 2.771/2.900/3.137/0.126 ms
      
      

      I've tried changing the routing table to allow for connections over usb0 that point to 192.168.144.52 to go over eth0, but I haven't had luck. I am unsure if there is something I'm doing wrong here.

      Here is my routing table:

      voxl2:/etc/modalai$ ip route
      default via 192.168.168.1 dev usb0 src 192.168.168.106 metric 209 
      169.254.0.0/16 dev eth0 proto kernel scope link src 169.254.208.31 metric 208 
      192.168.144.0/24 dev eth0 proto kernel src 192.168.144.21 metric 202 
      192.168.168.0/24 dev usb0 scope link src 192.168.168.100 
      

      I've also tried this routing table to enforce that we should be routing pings to 192.168.144.52 to eth0 :

      default via 192.168.168.1 dev usb0 src 192.168.168.106 metric 209 
      169.254.0.0/16 dev eth0 proto kernel scope link src 169.254.208.31 metric 208 
      192.168.144.0/24 dev eth0 proto kernel scope link src 192.168.144.21 
      192.168.144.52 dev eth0 scope link src 192.168.168.100 
      192.168.168.0/24 dev usb0 scope link src 192.168.168.100 
      
      

      The outcome is the same when changing the routing table. However, I know that changing the routing table is doing SOMETHING because if I remove all eth0 entries, I cannot ping any eth0 device.

      Am I thinking of this wrong? Is there anything I should try? Does the VOXL2 handle routing differently, or is there anything custom going on?

      ModeratorM 1 Reply Last reply Reply Quote 0
      • ModeratorM
        Moderator ModalAI Team @John Nomikos
        last edited by

        @John-Nomikos No, VOXL 2 is pretty vanilla Debian Linux. Routing should work the same as any other. Maybe you could use gstreamer to setup an RTSP server that takes in the IP Camera data?

        John NomikosJ 1 Reply Last reply Reply Quote 0
        • John NomikosJ
          John Nomikos @Moderator
          last edited by

          @Moderator Yep, I got routing through the VOXL2 working. The problem was actually in my host and the device I was pinging. I would have to setup static routing on both devices. But I ended up using a NAT on the VOXL2

          Thank you for the help!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB | Contributors