LinuxMCE Forums

General => Users => Topic started by: AndiHoffi on September 22, 2009, 04:43:49 pm

Title: What do I need two NICs for?
Post by: AndiHoffi on September 22, 2009, 04:43:49 pm
Hi,

I did not yet install LinuxMCE, but am currently reading the installation-instructions. What I am wondering most about is the definitive requirement of two NICs - one for the internal LAN and one for the external LAN. There is no doubt about it in the wiki.
Only the FAQ mention that it might be possible to have the core with only one NIC.

At home I have 3-4 PCs running and the core. Each of the PCs should have full access to all the information in the LAN, the internet and the core. There is of course also a WLAN-Router around to offer access to the internet, but I can turn the DHCP-functionality off.
Do I really need two NICs in this setup?
What are the drawbacks of having only one NIC?

Thank you very much for any information.

Regards
Andreas
Title: Re: What do I need two NICs for?
Post by: merkur2k on September 22, 2009, 04:58:13 pm
two nics is required for all the automagic network device detection (nas bricks, etc) and for all the filesharing stuff to work best, and for running additional media directors.
Title: Re: What do I need two NICs for?
Post by: jimbodude on September 22, 2009, 04:58:38 pm
The drawback of only having one NIC is that it won't work, and it will completely hose your current network.

Currently, the only supported configuration has 2 NICs, even if you simply leave one disconnected.  Read the FAQ and wiki article more carefully for a full explanation of the requirement.

http://wiki.linuxmce.org/index.php/Network_Setup
http://wiki.linuxmce.org/index.php/FAQ#Why_do_I_need_two_network_cards_in_my_Core.3F
Title: Re: What do I need two NICs for?
Post by: rperre on September 22, 2009, 05:37:51 pm
Basically your core will take over your routers function, it will be the dhcp handler and handle firewall for you, everything can be connected via a switch and/or AP to the internal NIC of the core. The core is supposed to be always on. Your core is and will be the gateway to your in house network.

This way you can still get to all your data/media/etc... on your network, you will not loose any of that functionality.

Richard
Title: Re: What do I need two NICs for?
Post by: skeptic on September 22, 2009, 06:46:39 pm
The drawback of only having one NIC is that it won't work, and it will completely hose your current network.
That's not completely true.  It's possible to run with only 1 nic if you set everything up correctly, I did for quite a while when my physical network setup wouldn't allow me the option.  It can be done without completely hosing the current network.  If you install on a box with only one nic the install will create and use a second virtual nic.
Quote

Currently, the only supported configuration has 2 NICs, even if you simply leave one disconnected.  Read the FAQ and wiki article more carefully for a full explanation of the requirement.

http://wiki.linuxmce.org/index.php/Network_Setup
http://wiki.linuxmce.org/index.php/FAQ#Why_do_I_need_two_network_cards_in_my_Core.3F
This is correct.  The only supported config is with 2 physical nics.  It's also highly recommended and just plain works better and easier.

OP - Technically you can use only 1 nic, but don't.  Take this from someone who has done it both ways.  If the core is just a core then it should be very easy, just put it where it shows on the diagram linked above.  If you are using the core as a core/md then you need to find a way to get your internet connection to the core/md is as well as a LAN connection to your switch (I didn't have this at first - the reason I went with 1 nic).  Save yourself some grief and get your LAN wired/configured to support this before you go forward with an LMCE install. 

If nothing else, look at the replies.  Everyone is telling you that you must use 2 nics.  I'm the only one saying it's possible to do it with 1 nic, but don't.  LMCE is designed to work with 2 nics and makes assumptions based on this.  You can still have a DMZ if for some reason you feel the need to have any computers with direct internet access, but even that should not be necessary.
Title: Re: What do I need two NICs for?
Post by: jimbodude on September 22, 2009, 07:50:01 pm
The drawback of only having one NIC is that it won't work, and it will completely hose your current network.
That's not completely true.  It's possible to run with only 1 nic if you set everything up correctly, I did for quite a while when my physical network setup wouldn't allow me the option.  It can be done without completely hosing the current network.  If you install on a box with only one nic the install will create and use a second virtual nic.

The default configuration will always make sure there are at least 2 NICs, even if it has to create a virtual adapter that shares the physical adapter.  If you do no further configuration - for example, if do not understand the intricacies of how LinuxMCE configures the network and how to adjust your own network setup accordingly - then you will have 2 DHCP servers which will conflict - effectively hosing your network...

If you move forward with 1 NIC, and you're savvy enough to disable the DHCP on your router, you're still not out of the woods - since now you don't have a route to the internet - effectively hosing your network.

If you move forward with 1 NIC, disable the router's DHCP, and configure your Core's network setup just right (which takes at least some networking knowledge), then you've introduced an unnecessary point of failure into the setup, and you have an overcomplicated network for your home - but it does work ok.  Of course, as soon as you tell anyone you have a 1 NIC setup you'll get flamed, because such a setup is "not supported".

2 out of 3 cases end in hosing your network.  1 requires a fairly significant amount of smarts - I'd guess that if one has enough smarts to get to that point, they would have read the FAQ and the Network Setup and immediately known how to get to that point.  After that realization, one would immediately realize that such a setup doesn't really provide anything except extra work and complexity.

The bottom line is exactly what I said - put 2 NICs in the box (what's an extra NIC? $10?), save yourself a bunch of configuration work and unplanned downtime due to configuration mistakes or accidents or poor assumptions in the code, and avoid the flame war that this stupid topic always brings up.  Anything is technically possible - it is Linux after all, and Linux is pretty good in the networking department - but the practical points outweigh the "it should be possible this way" points on this particular issue.

OP - Technically you can use only 1 nic, but don't.  Take this from someone who has done it both ways.
Join the club.
Title: Re: What do I need two NICs for?
Post by: skeptic on September 22, 2009, 08:12:33 pm
Agree 100%.  I just wanted to point out that it is possible to run with 1 nic if you are in a situation like I was - no practical way to get a connection from both your internal and external networks to a core/md hybrid.  It's just not worth it, it's better to find a way to get the wiring addressed to support it. 
Title: Re: What do I need two NICs for?
Post by: totallymaxed on September 22, 2009, 10:20:48 pm
Agree 100%.  I just wanted to point out that it is possible to run with 1 nic if you are in a situation like I was - no practical way to get a connection from both your internal and external networks to a core/md hybrid.  It's just not worth it, it's better to find a way to get the wiring addressed to support it. 

Your absolutely right skeptic...I have run my home Core that way for years....it works 100% fine if its setup that way correctly.

All the best

Andrew
Title: Re: What do I need two NICs for?
Post by: colinjones on September 22, 2009, 10:48:28 pm
AndiHoffi - its simple, read http://wiki.linuxmce.org/index.php/Network_Setup and it will answer all your questions.

It shows you how for the sake of a $15 NIC, you can easily setup the LMCE how it is supposed to be, and without much/any impact to your existing network.

Only even consider a single NIC installation if 1) you have read an understood the above article, but you have some unusual reason that means that the uphill battle represented by point 2 is still the path of least resistance for you, and 2) you have extensive networking experience on how to work around the 2 NIC requirement, and extensive LMCE experience to understand what this will break in LMCE and how to fix it, because if you go with a single NIC installation, you will find it extremely hard to find any support on the forums if/when it doesn't work or if it breaks at a later date.
Title: Re: What do I need two NICs for?
Post by: totallymaxed on September 23, 2009, 02:07:18 am
AndiHoffi - its simple, read http://wiki.linuxmce.org/index.php/Network_Setup and it will answer all your questions.

It shows you how for the sake of a $15 NIC, you can easily setup the LinuxMCE how it is supposed to be, and without much/any impact to your existing network.

Only even consider a single NIC installation if 1) you have read an understood the above article, but you have some unusual reason that means that the uphill battle represented by point 2 is still the path of least resistance for you, and 2) you have extensive networking experience on how to work around the 2 NIC requirement, and extensive LinuxMCE experience to understand what this will break in LinuxMCE and how to fix it, because if you go with a single NIC installation, you will find it extremely hard to find any support on the forums if/when it doesn't work or if it breaks at a later date.

Hasn't broken for me yet in let's see... Hmmm...nearly 5 years... ;-) ...hey but what do i know...

The only real issue I sometimes see is that if we have say 4-5 TV & DVD streams being served from my Core (in my system all the storage is in the Core itself) to the various MD's then all those streams are going up a single 100mbit LAN cable to the LAN side router...that sometimes causes some slight jerkiness in the video playback. Apart from that I've not see any NIC related problems at all I have to say.

All the best

Andrew
Title: Re: What do I need two NICs for?
Post by: AndiHoffi on September 23, 2009, 10:07:35 am
Thank you for all the answers.
Now at least I know that the trouble of wiring the core will probably be easier than setting up LinuxMCE without a 2nd NIC in the core.

What all the linked articles and the replies do not answer is the conceptual necessity of a 2nd NIC. If you want to distinguish between internal and external LAN, there is no doubt about the necessity of two NICs. But if you setup your network as outlined below, why can't you just put your broadband-router into the internal LAN (with DHCP turned off)?
http://wiki.linuxmce.org/images/3/38/After.PNG
If someone wants to access the internet directly from the internal LAN, it's fine by me :)

Or put differently:
In my home, the broadband-router and the remaining PCs are in the same room, but there is no chance to get an eithernet-cable to the core. With one NIC, I would just use the existing WLAN or a powerline-eithernet and I would be fine. But with two NICs I will be needing two distinct connections between the two rooms: broaband->core and core->PCs.
And I am getting curious about the conceptual reason for the decision to support two NICs only in LinuxMCE and make me go through the hassle of doing this setup.

Regards
Andreas
Title: Re: What do I need two NICs for?
Post by: ShamIAm on September 23, 2009, 11:01:31 am
It isn't about internal network and external network, it is about the Core controlling the topology. Two NIC's make the system more easily configured for PNP. LinuxMCE has several features that require certain network topologies, or at least knowledge of the network layout to work consistently, and when in the supported two NIC layout the core creates these topologies.

The diagram you reference seems to indicate two NIC's one to the left of the core (external), and one to the right(MCE network). You will need to connect the broadband router to the core on the switch part of the router, not the external interface port (once you disable the DHCP). You can also pickup a switch for about the same price as a NIC, sell your router on E-bay and probably pay for both.

Things like auto-detecting network devices when plugged into the network, Asterik, IP Cameras, Network booting MD's, and other things that I can't think of each have their own dependencies on the network configuration, for this to work and be PNP you need two NIC's unless you want to dive into how each of these packages interact with the DCE Router, the network, and Kubuntu. If you do please post your findings, several of us would like to know what you find.
Title: Re: What do I need two NICs for?
Post by: AndiHoffi on September 23, 2009, 11:37:19 am
The diagram you reference seems to indicate two NIC's one to the left of the core (external), and one to the right(MCE network). You will need to connect the broadband router to the core on the switch part of the router, not the external interface port (once you disable the DHCP). You can also pickup a switch for about the same price as a NIC, sell your router on E-bay and probably pay for both.
You are saying that I can connect everything including the broadband-router to the internal LAN and just leave the second NIC without any connection? Did I understand this correctly?
Quote
Things like auto-detecting network devices when plugged into the network, Asterik, IP Cameras, Network booting MD's, and other things that I can't think of each have their own dependencies on the network configuration, for this to work and be PNP you need two NIC's unless you want to dive into how each of these packages interact with the DCE Router, the network, and Kubuntu. If you do please post your findings, several of us would like to know what you find.
But why should the PNP-functions stop working only because I have a broadband-router in the internal LAN?
Title: Re: What do I need two NICs for?
Post by: wierdbeard65 on September 23, 2009, 11:45:09 am
But if you setup your network as outlined below, why can't you just put your broadband-router into the internal LAN (with DHCP turned off)?

What you need to remember is that (AFAIK) the ultimate goal is to have an appliance solution. I.e. plug it in and it works. To do what you suggest would require knowledge of the router and how to reconfigure it, as well as sorting out stuff like the default routes so the 'net is accessible.

Remember, most ISP's supply you with a connection assuming their router is the center of your network and that you know little to nothing about networking. MCE makes the same first assumption and will (I hope) eventually make the second. It's either a USB connection to 1 computer, or an ethernet connection (often with a built-in switch etc.) and provides all the DHCP etc. You end up with a "turf war" over who runs the network ;)

So, your choice is to hack in to your router and play with it's settings. Play with the default routes etc. or simply connect the router to a second NIC and let it "just work". If you don't want a second switch, you can use a crossover cable for this or (I have had working with Linux, but not with MCE) even the USB!

As everyone here is saying, why make work for yourself? Life's too short as it is!
Title: Re: What do I need two NICs for?
Post by: AndiHoffi on September 23, 2009, 12:21:17 pm
As everyone here is saying, why make work for yourself? Life's too short as it is!
First reason: Because I am a bit stubborn and would like to understand the reasons for limitations that cause me trouble :)
Second reason: Wiring will be tough.
Third reason: I like the ideas behind LinuxMCE and will probably be using many features in the future. But currently, I just want to do the first small step and do not need an always-on-media-server. But what I do need is an always-on-router for the internet-access. Thus the idea was to be able to turn the core/md off when it is not needed. An always-on-machine consumes more electricity and there is the risk of it being too loud for the living-room. When we are watching TV, the noise does not disturb anybody. But what about reading a book? Thus the one-NIC-approach is quiet charming.

The simplest solution for the moment seems to be to install XP-MCE or some other MCE-Solution that does not go as far as LinuxMCE for the moment. But I don't want to give up that easily :)
Title: Re: What do I need two NICs for?
Post by: tschak909 on September 23, 2009, 12:28:01 pm
If you want to understand why things are structured the way they are, check out the code and dig in.

-Thom
Title: Re: What do I need two NICs for?
Post by: wierdbeard65 on September 23, 2009, 12:34:06 pm
Well, if you are not planning on leaving it on all the time, then it can't be the DHCP for your network etc.

I'm kind of where you are.... What I've done is to leave my existing network alone. My test Core (I'm going for dedicated) is just a node on my internal network and is turned off when I'm not playing with it. I have the 2nd NIC and switch and my 1 MD is connected to that. Again, when I'm not playing, both are switched off.

Now, once I have got it all working, put in a production Core and, mopst importantly, got Family (well, wife!) buy-in, I will leave the core on and migrate my existing machines to the "internal" network.

The problem you have is that the whole way MCE "knows" about new devices is from their DHCP request. If it isn't the DHCP server, then it can't detect the devices and you've cripled the system. Add on to that that your MDs are diskless, so rely on DHCP to do a PXE boot from your core and you have a stack of broken bits.

As I said at the start, if you turn off your core, then it can't be your DHCP derver since the rest of your network will be without "leadership". (In your suggestion about putting your router on the "internal" network, you didn't mention wanting to turn your core off ;) )

On the cabling front, do you already have Cat5 to your location for your Core? If not, 2 cables isn't much more than 1. If so, you can always get splitters that let you use a single Cat5 / RJ45 for two connections. Alternatively, you could get clever and put in a mini switch and use VLans. There are lots of possibilities.

Finally, noise. That's one of the reasons I'm going for a dedicated core. Put it somewhere where the noise doesn't matter :D (Garage, under stairs or wherever).

HTH
Title: Re: What do I need two NICs for?
Post by: totallymaxed on September 23, 2009, 01:06:38 pm
As everyone here is saying, why make work for yourself? Life's too short as it is!
First reason: Because I am a bit stubborn and would like to understand the reasons for limitations that cause me trouble :)
Second reason: Wiring will be tough.
Third reason: I like the ideas behind LinuxMCE and will probably be using many features in the future. But currently, I just want to do the first small step and do not need an always-on-media-server. But what I do need is an always-on-router for the internet-access. Thus the idea was to be able to turn the core/md off when it is not needed. An always-on-machine consumes more electricity and there is the risk of it being too loud for the living-room. When we are watching TV, the noise does not disturb anybody. But what about reading a book? Thus the one-NIC-approach is quiet charming.

The simplest solution for the moment seems to be to install XP-MCE or some other MCE-Solution that does not go as far as LinuxMCE for the moment. But I don't want to give up that easily :)


In our customer installations we always fit two NIC's  - one WAN side that hooks up to the broadband router and gets its address from the router by DHCP, and the other NIC is LAN side and this would then have a Switch (or switches) attached to it to distribute the LAN around the property...the LAN side would get its DHCP offers from the Core. This installation assumes that at least the Core is on 24/7 otherwise DHCP and other services are lost.

....now in my home installation I have a single NIC (because my Core is creaky and old and has few slots!!) and my broadband router has its DHCP turned off on its LAN side. My Core attaches to one of the broadband routers ports and is the DHCP server on the LAN. It therefore must be switched on 24/7 as otherwise DHCP would fail...but also so would my families TV and DVD consumption ;-). The Core is always running becuase its always doing something...even in the middle of the night it is usually recording some weird TV show or movie...so we never turn it off (it uses about 42W).

Hope the above is helpful.

Andrew
Title: Re: What do I need two NICs for?
Post by: AndiHoffi on September 23, 2009, 01:11:37 pm
The problem you have is that the whole way MCE "knows" about new devices is from their DHCP request. If it isn't the DHCP server, then it can't detect the devices and you've cripled the system.
Good point. I forgot about that. So it has to remain always on...
Title: Re: What do I need two NICs for?
Post by: AndiHoffi on September 23, 2009, 01:15:05 pm
....now in my home installation I have a single NIC (because my Core is creaky and old and has few slots!!) and my broadband router has its DHCP turned off on its LAN side. My Core attaches to one of the broadband routers ports and is the DHCP server on the LAN. It therefore must be switched on 24/7 as otherwise DHCP would fail...but also so would my families TV and DVD consumption ;-). The Core is always running becuase its always doing something...even in the middle of the night it is usually recording some weird TV show or movie...so we never turn it off (it uses about 42W).
Sounds like the setup I was thinking about (except the always-on, but I think, I have to live with that). After some other posters wrote that it was very hard to set up, can you please write some more information about the trouble you had to go through to get this to work?
Thank you
Title: Re: What do I need two NICs for?
Post by: totallymaxed on September 23, 2009, 01:27:40 pm
....now in my home installation I have a single NIC (because my Core is creaky and old and has few slots!!) and my broadband router has its DHCP turned off on its LAN side. My Core attaches to one of the broadband routers ports and is the DHCP server on the LAN. It therefore must be switched on 24/7 as otherwise DHCP would fail...but also so would my families TV and DVD consumption ;-). The Core is always running becuase its always doing something...even in the middle of the night it is usually recording some weird TV show or movie...so we never turn it off (it uses about 42W).
Sounds like the setup I was thinking about (except the always-on, but I think, I have to live with that). After some other posters wrote that it was very hard to set up, can you please write some more information about the trouble you had to go through to get this to work?
Thank you

As ever the Wiki is your 'friend' in this type of situation ;-)

Look at this page for the steps needed to go with a single NIC; http://wiki.linuxmce.com/index.php/DHCP_Plug_and_Play (http://wiki.linuxmce.com/index.php/DHCP_Plug_and_Play)

My setup is the same as described except that the externally facing fixed address for my Core is 192.168.20.99 and my broadband router is on a fixed address of 192.168.20.1 (ie they are in the same subnet)

All the best

Andrew
Title: Re: What do I need two NICs for?
Post by: AndiHoffi on September 23, 2009, 03:04:55 pm
As ever the Wiki is your 'friend' in this type of situation ;-)

Look at this page for the steps needed to go with a single NIC; http://wiki.linuxmce.com/index.php/DHCP_Plug_and_Play (http://wiki.linuxmce.com/index.php/DHCP_Plug_and_Play)
Thank you very much. I did not find this page during my initial search.

Regards
Andreas