Tutorial: using Raspbmc on different networks

If you are using your Raspberry PI as media centre using RaspBMC, you are probably good to go in a few minutes, being RaspBMC a mature project that is now easy to install, configure and use.

RaspBMC Logo

However by default and for security reasons, Raspbmc’s “iptables restricts network to LAN only by default“. This means that if you have more than one router in your environment, your RaspBMC will be able to reach the internet and any device on its own LAN, but will not be seen by other devices in another lan.

If you try to ping it, it will not answer, unless you are on a device that is on the same lan.

Let’s see the following image to see a bit more in details a possible scenario:

Network_Topology

Let’s say that you have already put in place a static route to make sure that the computer on the first network segment can reach the second one and viceversa.

In order to be able to reach the RaspBMC machine, you will need to configure IPTables:

sudo iptables -I INPUT -s 192.168.0.0/24 -j ACCEPT

Then you will need to make this change permanent even after a reboot:

sudo apt-get install iptables-persistent

– Open the file /etc/rc.local:

sudo vi /etc/rc.local

– Add this line :

sudo /etc/init.d/iptables-persistent start

 

Done! Now your RaspBMC will be reachable from any other machine in the specified network segment (192.168.0.0/24)…

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.