Difference between revisions of "DHCP Plug and Play"

From LinuxMCE
Jump to: navigation, search
(Single NIC & Existing DHCPd)
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
[[category:Networking]]
 +
 +
 
<p>LinuxMCE allows a user to plug in any type of device and automatically configures it and lets the user start using it right away without doing anything.  The way this is accomplished is with an extension to the DHCP server. When a new device is plugged into the network and requests an IP address, this program connects to a central database to do a lookup of the device's unique MAC address to see what type of device it is.  The database defines all the configuration data the device needs to run, and references the software drivers needed.  This program then downloads and installs any needed software, adds configuration pages for the device to the user's [[LinuxMCE Admin Website]], and adds the device in the user's local database.</p>
 
<p>LinuxMCE allows a user to plug in any type of device and automatically configures it and lets the user start using it right away without doing anything.  The way this is accomplished is with an extension to the DHCP server. When a new device is plugged into the network and requests an IP address, this program connects to a central database to do a lookup of the device's unique MAC address to see what type of device it is.  The database defines all the configuration data the device needs to run, and references the software drivers needed.  This program then downloads and installs any needed software, adds configuration pages for the device to the user's [[LinuxMCE Admin Website]], and adds the device in the user's local database.</p>
  
==Single NIC & Existing DHCPd==
+
=Single NIC & Existing DHCPd=
 
LinuxMCE recommends its core server have 2 ethernet ports, connecting one to an existing LAN (that routes to the Internet), and the other to a LAN segment on which sit all devices that LMCE will serve. That recommended setup runs a DHCP server (DHCPd) on LMCE to assign IP numbers and other network configs to devices on the "inside" LAN served by LMCE. LMCE runs a DHCP client on its "outside" LAN interface to get its IP# (and any other configs the existing LAN might assign) on that outside LAN. LMCE than routes inside LAN traffic to the outside LAN, including to any router/gateway on the outside LAN, while running a firewall that protects devices on the inside from activity on the outside.
 
LinuxMCE recommends its core server have 2 ethernet ports, connecting one to an existing LAN (that routes to the Internet), and the other to a LAN segment on which sit all devices that LMCE will serve. That recommended setup runs a DHCP server (DHCPd) on LMCE to assign IP numbers and other network configs to devices on the "inside" LAN served by LMCE. LMCE runs a DHCP client on its "outside" LAN interface to get its IP# (and any other configs the existing LAN might assign) on that outside LAN. LMCE than routes inside LAN traffic to the outside LAN, including to any router/gateway on the outside LAN, while running a firewall that protects devices on the inside from activity on the outside.
  
However, it is possible to run LMCE on a host with a single ethernet port. There is some complexity in the configuration, the solution is not as fully automated and robust as is the recommended 2 ethernet version, and the omission of the LMCE firewall reduces the overall security of the installation. However, it is possible to do. These are instructions, including switching the LAN from an existing DHCP server to using the LMCE DHCPd instead. AFAICT, this technique doesn't leave any wrong configurations anywhere inside either LMCE's complex interdependencies or the remnants of the previously existing DHCP system.
+
However, it is possible to run LMCE on a host with a single ethernet port. There is some complexity in the configuration, the solution is not as fully automated and robust as is the recommended 2 ethernet version. However, it is possible to do. These are instructions, including switching the LAN from an existing DHCP server to using the LMCE DHCPd instead.  
 +
 
 +
*In existing router/gateway
 +
#Disable DHCPd
 +
#Assign LAN IP# on desired subnet (eg 192.168.0.1)
 +
#Ensure router/gateway is configured to route properly between the newly specified subnet and the other network
 +
 
 +
*In LMCE Admin site:
 +
#Homepage -> Advanced -> Network -> Network Settings
 +
#Make sure "Enable DHCP server" is checked, leave the ranges at their defaults, or at least in the 192.168.80.X range.
 +
#Configure the "External network card" staticly to be on the same subnet as the router (eg 192.168.0.X).
 +
#Leave the "Internal network card" setting at their defaults (eg 192.168.80.1).
 +
#Reoload the router
  
#In existing router/gateway
+
*Everything else on the network
##Disable DHCPd
+
#If it uses DHCP, either refresh it's IP-number manually or simply reboot it.
##Assign LAN IP# on desired subnet (eg 192.168.0.1 )
+
##Ensure router/gateway is configured to route properly between the newly specified subnet and the other network
+
# In LMCE Admin site:
+
##Homepage -> Advanced -> Network -> Network Settings
+
##Change all 192.168.80.x IP#s to desired subnet (eg. 192.168.0.x )
+
##Set both NICs to the same IP# (and proper subnet info)
+
##Reload DCERouter
+
##Check Homepage -> Advanced -> Network -> Network Settings to be sure settings were properly retained
+
#/etc/dhcp3/dhcpd.conf :
+
##Ensure "option routers" parameter(s) is the correct IP#(s) of the existing router(s)
+
##Exclude router/gateway IP# from allocatable ranges
+
##Change "host px[1,2]" lines from 192.168.80.x IP#s to desired subnet IP#s (eg. 192.168.0.253 )
+
##/etc/init.d/dhcp3-server restart
+
##Force a LAN host to reset its network configs by DHCP, then test pinging across the router
+
# Force each host on the LAN to reread its network configs by DHCP (eg. run its DHCP client or reboot if its DHCP client runs at startup).
+
  
Note that the dhcpd.conf file regenerated by the LMCE Admin site's Network Settings form has a bug which doesn't change all the IP#s properly. There might be other bugs, so check the whole file to be sure it's correct.
+
=Switching From Single NIC to Double NIC=
 +
There are instructions for switching from [[Single to Double NIC]].
  
===Caveat===
+
==See also==
This technique leaves a problem in that any configs of your original router/gateway DHCPd are not available to the LMCE DHCPd, unless you manually recreate them in the LMCE's dhcpd.conf file. Also, the router/gateway LAN IP# must be manually discovered/set, and then the LMCE LAN subnet must be manually configured to accommodate it. There is no way to fix that problem, unless the router/gateway allows its LAN IP# to be set by DHCP (ie. a DHCP client running on the router/gateway that is set by the LMCE DHCPd). Conversely, there is no way for LMCE to insert into the router/gateway DHCPd configs the configs that LMCE needs clients for its own services (like IP phones) to automatically get from a DHCPd when they're plugged into a network. The only way to make DHCP fully automatic for LMCE is to use the recommended network architecture of a pair of ethernet ports on the LMCE server (or use a router/gateway DHCPd that can be remotely configured by the LMCE, and a script to glue them together).
+
* [[Network Settings]]
 +
* [[How to setup Local Authoritative DNS]]

Latest revision as of 22:56, 19 October 2012


LinuxMCE allows a user to plug in any type of device and automatically configures it and lets the user start using it right away without doing anything. The way this is accomplished is with an extension to the DHCP server. When a new device is plugged into the network and requests an IP address, this program connects to a central database to do a lookup of the device's unique MAC address to see what type of device it is. The database defines all the configuration data the device needs to run, and references the software drivers needed. This program then downloads and installs any needed software, adds configuration pages for the device to the user's LinuxMCE Admin Website, and adds the device in the user's local database.

Single NIC & Existing DHCPd

LinuxMCE recommends its core server have 2 ethernet ports, connecting one to an existing LAN (that routes to the Internet), and the other to a LAN segment on which sit all devices that LMCE will serve. That recommended setup runs a DHCP server (DHCPd) on LMCE to assign IP numbers and other network configs to devices on the "inside" LAN served by LMCE. LMCE runs a DHCP client on its "outside" LAN interface to get its IP# (and any other configs the existing LAN might assign) on that outside LAN. LMCE than routes inside LAN traffic to the outside LAN, including to any router/gateway on the outside LAN, while running a firewall that protects devices on the inside from activity on the outside.

However, it is possible to run LMCE on a host with a single ethernet port. There is some complexity in the configuration, the solution is not as fully automated and robust as is the recommended 2 ethernet version. However, it is possible to do. These are instructions, including switching the LAN from an existing DHCP server to using the LMCE DHCPd instead.

  • In existing router/gateway
  1. Disable DHCPd
  2. Assign LAN IP# on desired subnet (eg 192.168.0.1)
  3. Ensure router/gateway is configured to route properly between the newly specified subnet and the other network
  • In LMCE Admin site:
  1. Homepage -> Advanced -> Network -> Network Settings
  2. Make sure "Enable DHCP server" is checked, leave the ranges at their defaults, or at least in the 192.168.80.X range.
  3. Configure the "External network card" staticly to be on the same subnet as the router (eg 192.168.0.X).
  4. Leave the "Internal network card" setting at their defaults (eg 192.168.80.1).
  5. Reoload the router
  • Everything else on the network
  1. If it uses DHCP, either refresh it's IP-number manually or simply reboot it.

Switching From Single NIC to Double NIC

There are instructions for switching from Single to Double NIC.

See also