Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Atm i'm testing it on Ubuntu Server at VMware Workstation + Windows 7 local host with bridged connection. Later this has to go to live server.

I have VLC streaming video file on Ubuntu with

cvlc -vvv /home/user/file.avi --loop --sout '#rtp{access=udp,mux=ts,dst=239.1.1.1,port=32321,caching=10000}'

later this stream is picked by udpxy as

udpxy -a lo -m eth0 -p 7777 &

Basically everything works well but my hosting provider is counting the UDP traffic as outbound though i dont need it anywhere outside. My idea is to block multicast UDP outbound traffic.

I've tried to use

route add -net 239.0.0.0/8 dev lo

the traffic is limited (cannot access it outside) but the

dumprtp 239.1.1.1 32321

on same server is not working neither.

Also i've tried creating new loopback interface for multicast addresses in /etc/network/interfaces like this

auto lo lo:udp
iface lo inet loopback

iface lo:udp inet static
    address 239.1.1.1
    netmask 255.0.0.0
    network 239.0.0.0

I was just trying to get it work, but it does not.

So basically i want the multicast udp traffic stay inside server without going out to the exterior network. And it should be multicast udp (stream is also picked by storage system and stream quality tests).

Thanks.

share|improve this question
    
have you looked into iptables? –  XyZZy May 12 '13 at 14:49
    
yes i did. My try was iptables -A OUTPUT -p udp -d 239.1.1.1 --dport 32321 -o eth0 -j DROP and it blocks udp traffic completely. Including inside server. Cannot read it with dumprtp 239.1.1.1 32321 –  Johnatan May 12 '13 at 14:56
    
hmm, yeah, that is weird... that rule should only block packets going to eth0. Maybe UDP always passes through eth0, since it is a network address. You can try creating a virtual network and sending udp packets to that network. so don't just create a udp loopback, you'll need to create an new complete interface with it's own IP-address. –  XyZZy May 12 '13 at 15:05
    
That's what i've tried by creating new interface for loopback. Maybe i did it wrong? Is it valid to create static interface with address 239.1.1.1 ? That address is reserved for multicast only. But that is what i need to re-route from eth0. –  Johnatan May 12 '13 at 15:06
1  
Good thing that I decided to follow up and see if there was activity. Hint: If you "tag" a person with something like @killermist, it'll notify them that they've been responded to. Anyway, on to business. Shot in the dark, have you considered using "dst=127.0.0.1" (the authoritative localhost IP) instead of "dst=239.1.1.1" in the cvlc command? –  killermist May 29 '13 at 11:13

1 Answer 1

up vote 0 down vote accepted

The solution was:

  1. Add new option --miface=lo to VLC: cvlc -vvv /home/user/file.avi --loop --sout '#rtp{access=udp,mux=ts,dst=239.1.1.1,port=32321,caching=10000}' --miface=lo
  2. Add route to lo for multicas addresses: route add -net 239.1.1.0 netmask 255.255.255.0 dev lo

    2a. To make route persistent we have to add it to /etc/network/interfaces with prefix up. Like this: up route add -net 239.1.1.0 netmask 255.255.255.0 dev lo

That's it. Now VLC is streaming to lo interface and not to eth0. Also any application that wants to subscribe for 239.1.1.1 - 239.1.1.254 gonna do it through lo interface.

Hopefully this gonna help someone solve streaming issue.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.