Author Topic: only one nic - still everything possible  (Read 4735 times)

deepB

  • Regular Poster
  • **
  • Posts: 34
    • View Profile
only one nic - still everything possible
« on: July 15, 2013, 06:13:19 pm »
Hello,

I am installing LinuxMCE on a virtual machine (proxmox, distribution specialized on managing KVM machines), but the host machine only has one NIC card. Also I have a Cable Modem/Router/WIFI-AP that I would like to keep.

Shouldn't it be possible to set the router to an adress, eg 10.0.1.1, with a subnet mask of 255.255.0.0

Then I could have the LinuxMCE server with an external IP adress of 10.0.1.2, and an internal IP adress of 10.0.0.1. I could turn off the DHCP on the router/modem/Wlan-ap and turn on the DHCP server on LinuxMCE for everything. This should lead to a setup that behaves exactly like the one with 2 NICs, or am I somehow wrong?

Best regards
Daniel

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: only one nic - still everything possible
« Reply #1 on: July 15, 2013, 10:19:57 pm »
Network setup with one nic is possible, although it may require some manual changes (I haven't tried the install on a one nic system in a while). But therein lies the potential problems.. unless you are familiar with LMCE and networks in general, you may run into some issues, and if asked, this forum will simply tell you to use two nics. (The important thing is to use LMCE for DHCP, as it seem you already know)

Best regards,
sambuca

deepB

  • Regular Poster
  • **
  • Posts: 34
    • View Profile
Re: only one nic - still everything possible
« Reply #2 on: July 17, 2013, 05:19:31 pm »
ok, this question is moot for me now, I need a new wifi-ap anyway, and then I'll just go for the recommended setup.

Thanks for the input anyway.

Best regards
Daniel

toppot

  • Veteran
  • ***
  • Posts: 52
    • View Profile
Re: only one nic - still everything possible
« Reply #3 on: July 19, 2013, 08:50:17 am »
Just wanted to add my 2 cents - since this poppes up every now & then...

You should go for 2 networks, this simplifies everything. But please remember (and this goes for all, see example like this thread http://forum.linuxmce.org/index.php/topic,13316.0.html):

2 networks can easily and happily work on 1 physical network, and 1 network card can just as easily have 2 IP addresses! So in this concrete example:

Set the IP of the router to 10.0.0.1 (netmask 255.255.255.0) - disable DCHP
Set external ip on your core to 10.0.0.2 (on card eth0), gateway 10.0.0.1
Set internal ip on core to 192.168.0.1 on card eth0, which is referred to as eth0.0...

From a logical point of view you have 2 networks, and every issue with regards to the internal workings of LMCE is unaffected. Any machine in your network will never become aware of the fact that you are running 2 logical networks in the same physical wires.. It is completely transparent, except for instances that relies on broadcasts - but just concern yourself with letting that run in the 192.168 network - and it will if you just let DHCP run from the core, and nowhere else..

So even if you mixed up netmask with logical network topology, your idea works - and the only real drawback in your suggestion is the overhead that comes from enlarging the subnet.. So stick with class C subnets (255.255.255.0). Your LMCE DHCP server will route the traffic anyway..

-TOP


ok, this question is moot for me now, I need a new wifi-ap anyway, and then I'll just go for the recommended setup.

Thanks for the input anyway.

Best regards
Daniel

essem_9

  • Regular Poster
  • **
  • Posts: 31
  • Fascinated by LMCE
    • View Profile
Re: only one nic - still everything possible
« Reply #4 on: July 24, 2013, 05:20:07 pm »
I am not sure if it is the best solution to to have two subnets on the same VLAN (eth0). I have a VLAN capable wired switch and following is what i do:
1. Create two VLANs: VLAN 1 and VLAN 80 on the wired switch port
2. Plug LMCE's eth0 in to that port
3. Install vlan package on LMCE (apt-get install vlan)
4. Modify /etc/network/interfaces as follows

# --- External NIC ---
iface eth0 inet dhcp
   pre-up sysctl -q -e -w  net.ipv6.conf.eth0.disable_ipv6=1

# --- Internal NIC ---
iface eth0.80 inet static
   address 192.168.80.1
   netmask 255.255.255.0
   pre-up sysctl -q -e -w  net.ipv6.conf.eth0.80.disable_ipv6=1

#####
# Activating interfaces
#####
auto eth0 eth0.80 lo

5. In my case I actually have a two ethernet NICs, however i am running out of wired ports on my wired switch hence use just one. Since i have two ethernet NICs I had to do the following to avoid LMCE getting confused.
Navigate to sudo vim /etc/udev/rules.d/70-persistent-net.rules
Change the name eth1 to eth2

6. Reboot the LMCE. It should come up with two interfaces: eth0 and eth0.80. Since the wired switch is trunked with VLAN1 and VLAN 80, we essentially have two networks and all works well