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.

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

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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|improve this answer

Try adding DNS servers to your DHCP options. Your TV may also need something else such as domain name. If your TV worked with some other router, I'd look into a DHCP monitoring tool (don't know of one off hand), see what options that DHCP server handed out, and mimic them with your configuration.

Also, did you echo 1 > /proc/sys/net/ipv4/ip_forward?

Third, if your range stanza really looks like range 10.0.05 10.0.0.10 it probably needs to be changed to range 10.0.0.5 10.0.0.10.

Allright, after doing a little bit of homework, it seems DLNA uses SSDP as a discovery protocol. From the "Simple Service Discovery Protocol" Wikipedia page:

SSDP is a text-based protocol based on HTTPU. It uses the User Datagram Protocol (UDP) as the underlying transport protocol. Services are announced by the hosting system with multicast addressing to a specifically designated IP multicast address at port number 1900. In IPv4, the multicast address is 239.255.255.250[3] and SSDP over IPv6 uses the address set ff0X::c for all scope ranges indicated by X.[4]

I don't have a lot of experience with multicast traffic on Linux but it looks like you possibly need to enable reception and forwarding of multicast traffic for this to work.

share|improve this answer
    
I've allready enabled forward options. Forgot to mention . Will update question –  2r2w May 7 '12 at 13:44
    
range is ok. it is just typing mistake –  2r2w May 7 '12 at 13:46
    
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. –  2r2w May 7 '12 at 13:47
    
see edit....... –  ultrasawblade May 7 '12 at 13:57
    
thanks. I've already accepted an answer –  2r2w May 7 '12 at 17:37

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.