DLNA communication through the router

Discover how you can configure DLNA client so it can communicate with DLNA server that operates behide the router.


Smart TV (DLNA client) <-> Ubuntu PC (router) <-> DLNA server

Smart TV – eth0
Ubuntu PC – eth0, wlan0
DLNA server – eth0
Internet gateway (ddwrt) – br0

DLNA discovery

DLNA server will send a notify packet to multicast group and UDP port 1900 and all DLNA clients will receive that packet sent to this multicast group. Packet will contain an IP address and port on which DLNA server is listening on, then client will be able to start a unicast communication with the server over IP address and TCP port 8200 (default port).

In order to provide this kind of communication through the router we have to configure a static multicast routing. We can configure multicast routing with smcroute tool (allows you to manipulate with multicast static routes which are part of the Linux kernel)

smcroute installation

First we have to be sure that multicast support is enabled in the Linux kernel




Install smcroute package on Ubuntu OS

Multicast routing

Adding multicast static routes after system boot
Add these lines to /etc/rc.local file

For some reason multicast routing isn’t enabled for wlan0 interface during the boot process so we have to stop and then start smcroute service so we can activate multicast routing for both interfaces.

In order to check if multicast routing (mc_forwarding read-only kernel parameter) is enabled for particular interface you can use sysctl tool. Value of 1 means routing is enabled and value of 0 means routing is disabled


IP routing

In order to activate IP routing we have to:

  • Activate IP routing on Ubuntu system
  • Configure a static route on the internet Gateway (ddwrt)

Activate IP routing on Ubuntu system

In order to provide internet communication and communication to other local networks ( to all devices from network (in our case SmartTV) we have to activate IP routing:

Configure a static route on the internet Gateway (ddwrt)

In the last step we have to configure a static route on the internet Gateway (in our case ddwrt) for network. This will allow our Smart TV (DLNA client) to receive data back from the local network and from the internet.

Alnalyzing multicast traffic

If we want to analyze network traffic on both interfaces we can use:


And if we want some more information related to the network traffic running through the Ubuntu router we can always use more advanced tools like tcpdump and wireshark

Leave a Comment

Your email address will not be published. Required fields are marked *