Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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=,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 dev lo

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

dumprtp 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

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).


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 --dport 32321 -o eth0 -j DROP and it blocks udp traffic completely. Including inside server. Cannot read it with dumprtp 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 ? 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
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=" (the authoritative localhost IP) instead of "dst=" in the cvlc command? – killermist May 29 '13 at 11:13
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=,port=32321,caching=10000}' --miface=lo
  2. Add route to lo for multicas addresses: route add -net netmask 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 netmask dev lo

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

Hopefully this gonna help someone solve streaming issue.

share|improve this answer

Your Answer


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.