Author Topic: LinuxMCE as DHCP server, NOT gateway!  (Read 32841 times)

Oatz

  • Regular Poster
  • **
  • Posts: 15
    • View Profile
LinuxMCE as DHCP server, NOT gateway!
« on: March 26, 2009, 06:04:44 pm »
So I have an issue with LinuxMCE and my network design and here is my "so-far" working solution.
Perhaps someone could let me know if I have broken anything I don't know about, let me know how nutty I am, etc.
First off, I'm a DD-WRT junkie. I love this tight little linux package on my routers and the way it turns all the iptables, OpenVPN, QOS, etc. linux complexity (and goodness!!!) into a easy to use web GUI.

At first I installed LinuxMCE 710 and turned my DDWRT router into a stupid switch, letting LinuxMCE handle all the dhcpd, DNS, gateway, etc. But I'm seriously missing a ton of things that were configured in my DDWRT router:
- QOS
- WAN thoughput and statistics (in colorful little pngs!)
- OpenVPN
- Much more

Now sure you can do ALL of this stuff in Kubuntu + a degree in Linux networking. But DDWRT gives me all this without said degree and leaves my Linux brain to worry about other more interesting things, like media scripts and flickr photos syncing ;)

Sure the ideal solution for me would be to have the DD-WRT super awesome WebGUI merged with LinuxMCE (*cough*), but until that great day.....

I decided enough was enough, the simple port forwarding thingy in the LinuxMCE admin tool was not going to cut it as my DDWRT replacement. So here it goes:

Project LinuxMCE as DHCPD (192.168.80.1) and DDWRT Router (Netgear 834Bv2 192.168.80.150) as DNS, GATEWAY + all the other DDWRT goodies! YAY!

1) sudo su

2) Edited 1 line in /etc/resolv.conf to add my DDWRT router as DNS resolver
Code: [Select]
nameserver 192.168.80.150

3) Edited /etc/network/interfaces and added the gateway (FYI eth1 now is disconnected, would like to remove this interface completely!)
Code: [Select]
auto lo
        iface lo inet loopback

auto eth1
iface eth1 inet dhcp
auto eth0
iface eth0 inet static
        address 192.168.80.1
        netmask 255.255.255.0
        gateway 192.168.80.150

4) Edited /etc/dhcp3/dhcpd.conf and changed the routers line
Code: [Select]
option routers 192.168.80.150;

5) Restarted the involved daemons:
/etc/init.d/./networking restart
/etc/init.d/./dhcp3-server restart
/etc/init.d/./dhcdbd restart

Now I have my cake and I'm eating it. Perhaps this cake is not as good as I think it is, perhaps this cake smells funny? But so far ignorance is bliss.

The big question here is: Does LinuxMCE really need to serve any core network role beyond a DHCP server?





« Last Edit: March 26, 2009, 06:08:14 pm by Oatz »

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #1 on: March 26, 2009, 06:11:11 pm »
You will need to redo any changes you do to the dhcpd.conf file each time you add another MD, or add any network device, that is controlled via lmce as the dhcpd conf gets re-created.

Oatz

  • Regular Poster
  • **
  • Posts: 15
    • View Profile
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #2 on: March 26, 2009, 06:17:13 pm »
Thanks.
Hmm I would like to avoid a hack, such as a CRON job that changes that line back to 192.168.80.150 and restarts the DHCPD daemon.
Does anyone know where in the LinuxMCE scripts it rewrites that dhcpd.conf file once a new device is added?

I will search...

dbs

  • Newbie
  • *
  • Posts: 11
    • View Profile

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #4 on: March 26, 2009, 07:41:57 pm »
Thanks.
Hmm I would like to avoid a hack,

Then PLEASE, use the core as your gateway. Everything else is a hack.  :'(

Oatz

  • Regular Poster
  • **
  • Posts: 15
    • View Profile
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #5 on: March 26, 2009, 08:05:11 pm »
Thanks.
Hmm I would like to avoid a hack,

Then PLEASE, use the core as your gateway. Everything else is a hack.  :'(
True. But.... so far this config works fine!
And where would Linux or LinuxMCE be if it weren't for hacks?

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #6 on: March 26, 2009, 08:48:38 pm »
Not an answer to your question, but you sound like a good candidate for Vera (www.micasaverde.com)
It is made by the creators of Pluto - and in simple terms its a Core running on DD-WRT... and its LMCE compatible (uses DCERouter). With your experience with DD-WRT, this might be right up your alley. Also, I think they're still doing an earlybird special where you can get a great price.

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #7 on: March 26, 2009, 10:57:30 pm »
Not an answer to your question, but you sound like a good candidate for Vera (www.micasaverde.com)
It is made by the creators of Pluto - and in simple terms its a Core running on DD-WRT... and its LMCE compatible (uses DCERouter). With your experience with DD-WRT, this might be right up your alley. Also, I think they're still doing an earlybird special where you can get a great price.

Micasaverde's Vera is actually built on top of Open-wrt  http://openwrt.org/

All the best

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

jondecker76

  • Alumni
  • wants to work for LinuxMCE
  • *
  • Posts: 763
    • View Profile
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #8 on: March 27, 2009, 12:08:05 am »
sorry - Yes, Andrew is correct. Still, it may be worth checking if it offers the types of features you are looking for

Oatz

  • Regular Poster
  • **
  • Posts: 15
    • View Profile
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #9 on: March 30, 2009, 05:34:12 am »
micasaverde looks cool, but I'm stuck on open-source (free) software for my media center. I'm also pretty cheap. Thanks for the help and links, this hack doesn't seem to be sustainable with all the rewriting in /etc/ each time a device is added, or the core rebooted.

I'm going to write some quick and dirty bash scripts to automate all of the config changes to change the gateway. Will post these if anyone else is interested.

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #10 on: March 30, 2009, 08:24:24 am »
Oatz,

would you mind looking at the webadmin code for the network settings, and see if you can enhance that code, instead of creating an external script.

unsolicited

  • Veteran
  • ***
  • Posts: 50
    • View Profile
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #11 on: April 07, 2009, 07:51:58 pm »

would you mind looking at the webadmin code for the network settings, and see if you can enhance that code, instead of creating an external script.

I'll put in another vote for that.

The webmin interface for dhcpd is pretty basic vis a vis all the goodies dhcpd offers. Extending / integrating the webmin interface / scripts to embrace that goodness seems like a positive step.

For example, if dcerouter is going to re-write dhcpd.conf upon device detection / removal, the scripts that do that could be changed to embrace the current .conf / change only its pieces, rather than rewriting it. OR, provision could be made to include locally defined preferences.

Is that idea reasonable?

Where would one look to start down that path? A particular developer forum, from which questions regarding dhcp interaction / scripts involved, could be inquired about?
c. 2009 - ALL rights reserved. No duplication, in whole or in part, permitted.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #12 on: April 07, 2009, 08:21:56 pm »
You need to check out code here in SVN:

http://svn.linuxmce.org/svn/branches/LinuxMCE-0810/

The relevant pieces are src/PlutoDHCP, src/BootScripts, src/Plug_and_Play_Plugin, and a few others that I can't remember right off the top of my head.

-Thom

unsolicited

  • Veteran
  • ***
  • Posts: 50
    • View Profile
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #13 on: April 07, 2009, 08:33:39 pm »
The relevant pieces are src/PlutoDHCP, src/BootScripts, src/Plug_and_Play_Plugin, and a few others that I can't remember right off the top of my head.

Thanks for that.

Reality check please: If things were 'that simple' would it not have been done already? i.e. If what I'm thinking / suggesting here has not already been done, there must be a reason. If the reason is for lack of eyeballs on the issue, that's one thing. If the reason is there's way more complexity in there than is apparent to the naked eye, that's another.

e.g. I'm sensing that database schema changes would be required, and I can't imagine that being a quick thing from the time of conceptualization through quality assurance and in to production.

So, reality check, please.
c. 2009 - ALL rights reserved. No duplication, in whole or in part, permitted.

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: LinuxMCE as DHCP server, NOT gateway!
« Reply #14 on: April 07, 2009, 08:51:42 pm »
Very astute,

you're going to find the changes aren't simple, simply because of the sheer scope of the system.

I've said this once
and I will say it again.

This isn't your daddy's media center.

It is a smart home platform, encompassing a huge amount of scope, and in order for it to work out of the box as intended, as smoothly as possible, the use case that was decided was for this device to be the center of everything in the house.

I've argued with people repeatedly on this issue, shown code, ran through use cases, but it has fallen upon deaf ears, mostly because nobody has been able to prove me wrong while maintaining our feature set.

I'm tired of arguing. Make a patch that keeps our functionality that allows what you want, or....set it up like we say.

-Thom