Sunday, February 27, 2011

Stream your Webcam over IPv6 using VLC

It's quite easy to stream your Webcam over IPv6. Here's the recipe for doing it on Ubuntu Linux:

  1. Make sure VLC is installed ("sudo apt-get install vlc")
  2. Make sure your webcam is connected
  3. Make sure VLC can see your webcam: "vlc v4l2:///dev/video0" should show what your webcam sees.
  4. Now start VLC as a streamer on port 4444 (or choose another free port above 1024) with this one command: 

    cvlc -vvv v4l2:///dev/video0  --sout '#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:standard{access=http,mux=ogg,dst=[::]:4444}'

  5. Find out the IPv6 address of your streaming machine, for example with ifconfig or via http://test-ipv6.com/ . Let's say it's 2001:888:aaa::1.
  6. Still on the same machine, make sure you can watch the stream locally:

    vlc http://[ip6-localhost]:4444/

    vlc http://[2001:888:aaa::1]:4444/


  7. Now, on another machine with IPv6 and VLC, you can watch your webcam stream with the same command above, so 

    vlc http://[2001:888:aaa::1]:4444/

    If you're more a GUI person, you can open VLC, and put the URL in Media -> Open Network Stream -> Network.
  8. That's it.

Tuesday, February 1, 2011

Enabling IPv6 Privacy Extensions on Ubuntu Linux

On plain Ubuntu (and probably other Linux variants), the right hand part of the IPv6 address is based on your MAC address. As your MAC address is fixed and worldwide unique, you can be traced around the (IPv6) world based on your IPv6 (containing your MAC address). And often this is not wanted.

There's a solution for this called "IPv6 Privacy Extensions". It will give you semi-random IPv6 address, that will be changed regularly. The result is less tracking and more privacy.

Here's how to enable IPv6 Privacy Extensions on Ubuntu and probably other Linux variants:

As root, edit the file /etc/sysctl.conf, for example:

gksudo gedit /etc/sysctl.conf

In that file, add these lines:

net.ipv6.conf.wlan0.use_tempaddr = 2
net.ipv6.conf.eth0.use_tempaddr = 2
net.ipv6.conf.all.use_tempaddr = 2
net.ipv6.conf.default.use_tempaddr = 2

Save the file and exit the editor. Then reload your network, or just reboot.
(BTW: the above lines are based on interface eth0 and wlan0)

After the reboot, ifconfig will now show a second public IPv6 address on interface(s) that used to have only one public IPv6 address. On http://www.appelboor.com/ipv6.html and http://test-ipv6.com/ you should your new, "private" public IPv6 address.