How to alias an IP address to make DLNA resource accessible from different IP network

11,314

DLNA is broadcast only. So you will not be able to route broadcast packets from the 10.0.0.0/24 network to the 192.168.1.0/24 network.

The best approach would therefore be to not route at all, but instead use your notebook as a bridge, and put the DLNA resource and the TV on the same network. These are the steps.

  1. Get rid of the dhcp server and IP table rules off the notebook
  2. Bridge the interfaces of the notebook. How you do this is distribution dependent, so I'll give the debian/ubuntu syntax and you can adapt for your distro.

This is /etc/network/interfaces:

auto lo br0 

iface lo inet loopback

iface br0 inet static
    bridge_ports eth0 wlan0
    address 192.168.1.x
    netmask 255.255.255.0

Replace x with your current laptop IP address.

3) Set your TV to use DHCP

And that should be enough. The bridge will join the wired connection from the TV to the laptop with the wifi connection from the laptop to the rest of the network. As it is a bridge, the DLNA broadcasts will be forwarded across the bridge, and the responses will come back.

Also the bridging means that the DHCP broadcasts from the TV will also traverse the laptop, which is why you don't need a seperate DHCP server, it can use the one on your home network.

Share:
11,314

Related videos on Youtube

2r2w
Author by

2r2w

Updated on September 18, 2022

Comments

  • 2r2w
    2r2w over 1 year

    what I have

    I have a home wifi network 192.168.1.0/24 having DLNA resource 192.168.1.100.
    I have a TV with ethernet and a netbook with both wifi and ethernet interfaces.
    I want to make my notebook behave like a router. That means it gets my home network over wifi and forwards it through the ethernet interface to TV.

    what I want

    I want to make my tv recognize my dlna resource in my home network.

    what I have done

    I've setup a dhcp server on the netbook's eth0 interface with following subnet:

    subnet 10.0.0.1 netmask 255.255.255.0 {
      range 10.0.0.5 10.0.0.10;
      option routers 10.0.0.1;
    }
    

    I've setup my eth0 interface on netbook like this:

    ifconfig eth0 10.0.0.1/24 
    

    i've enabled forwarding :

    echo 1 > /proc/sys/net/ipv4/ip_forward
    

    I've added forwarding rules to iptables:

    iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
    iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT
    iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
    

    Now my TV gets a 10.0.0.5 ip address and I'm able to browse the internet, but my TV cannot find any DLNA resources.

    Question

    I think that the resource discovery only goes through 10.0.0.1/24, so my TV can't find the 192.168.1.100 resource. Please, tell me how can I make some kind of alias, so 192.168.1.100 became alias like 10.0.0.10

  • 2r2w
    2r2w about 12 years
    I've allready enabled forward options. Forgot to mention . Will update question
  • 2r2w
    2r2w about 12 years
    range is ok. it is just typing mistake
  • 2r2w
    2r2w about 12 years
    I've added my home network router 192.168.1.1 as DNS in dhcpd.conf, also forgot to mention this. But I think it makes no sense.