0

I have a server that has two ethernet ports, each one running on a separate NIC (eth0 and eth1). I would like to connect eth0 to a separate machine that streams video over UDP (and no other traffic) while the other interface (eth1) is connected to the network gateway/router.

I don't care if the udp traffic port does not connect to the wider network.

Thank you!

EDIT: Since this question was put on hold, I would like to further clarify my system as per the comments below. My system consists of a machine, running linux, with two ethernet NIC's. I am receiving a UDP stream on one of those ports from a direct LAN-LAN connection to a security camera, and even though I've been able to read the packets coming in from the camera using tcpdump I have yet to be seeing anything coming through via gstreamer which I plan on using to display the video.

Both ports have a static IP address, configured as seen below:

eth0 Link encap:Ethernet HWaddr 5C:F8:21:34:80:F6 inet addr:192.168.1.233 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::5ef8:21ff:fe34:80f6%132688/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1237 errors:0 dropped:0 overruns:0 frame:0 TX packets:90 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:113089 (110.4 KiB) TX bytes:14016 (13.6 KiB) Interrupt:99 eth1 Link encap:Ethernet HWaddr 5C:F8:21:34:80:F7 inet addr:192.168.1.234 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1%132688/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:330 errors:0 dropped:0 overruns:0 frame:0 TX packets:330 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:277171 (270.6 KiB) TX bytes:277171 (270.6 KiB) 

And the internal routing table:

Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 192.168.1.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth1 

The camera is on address 192.168.1.239, and broadcasts to my server directly over UDP. (the destination MAC is hardcoded into the packets) It is broadcasting an MJPEG stream, and when I take the packets saved by tcpdump I can rebuild it into the MJPEG.

however, when I use gstreamer using the following command:

gst-launch-1.0 udpsrc multicast-iface=eth0, port=1234 ! filesink location=foo 

foo does not save any data. I've used this machine to save udp streams using gstreamer in the past, but not when both ports were in use. IE, the video was coming from another machine, through the router, to this server in question.

So, why can't these packets, which the server clearly sees and understands (it's not dropping them at least) not get to my gstreamer program?

6
  • 1
    What is the question? When you connect eth0 or eth1 to the other machine, what do you expect to happen, and what do you observe that does not match your expectations?CommentedMar 1, 2017 at 16:03
  • The other server is streaming video over UDP, and when I connect eth0 to it directly, I would like to be able to receive that video stream using gstreamer
    – T. Wallis
    CommentedMar 1, 2017 at 18:16
  • Good. So you can receive it. What's the problem?CommentedMar 1, 2017 at 19:57
  • The packets appear in tcpdump/wireshark, with correct MAC/IP, but do not go into my gstreamer application, even when I specify the interface in gstreamer. So I figure that it's an internal routing issue.
    – T. Wallis
    CommentedMar 1, 2017 at 20:05
  • 1
    Some details via ifconfig or netstat might be handy.
    – thrig
    CommentedMar 1, 2017 at 22:22

1 Answer 1

0

Typically you'd assign your cross-connect its own /30 subnet, from another bit of RFC1918 (private) space. So you'd do something like this:

  • 192.168.1.234/24 is your LAN on eth1
  • 192.168.255.1/30 is this machine, on eth0 (the cross-connect)
  • 192.168.255.2/30 is the video source, on its end of the cross-connect

If you then 192.168.255.1 and 192.168.255.2 as the IP addresses for your UDP connection, it'll flow over eth0.

It is possible to do this using the same subnet as the LAN (using /32 routes, policy routing, or bridge tricks), but all of those are more complicated and more likely to have issues with confusing random programs.

(Quick explanation of /x notation: It's a short way of specifying the netmask, by counting the number of 1s [binary!] from the left/most significant bit. So /30 means a netmask of 255.255.255.252.)

2
  • Looks like that did it, along with having to use ifconfig eth0 up at boot since auto and allow-hotplug didn't appear to start the eth0 interface at boot when it starts receiving the UDP stream. But that's a question for another day.
    – T. Wallis
    CommentedMar 3, 2017 at 13:37
  • @T.Wallis Glad to hear the answer worked. BTW: auto eth0 or allow-hotplug eth0 should definitely work in /etc/network/interfaces, that indeed does sound like a good question if it's not. At least, presuming it wasn't just a typo.
    – derobert
    CommentedMar 3, 2017 at 16:02

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.