Koozali.org: home of the SME Server

(solved) Dummy NIC - permanent activation/deactivation on SME v9.1

Offline tomi

  • 11
  • +0/-0
Motto:                                                     

      "Each expert has a horizon of knowledge:
       when it narrows enough, he will proclaim 
      'this is my point of view!'"               

Hello everybody,


I have a remote (vps) server that has 3 NICs but can only use one of them.
I am not able to remove or disable any of these boards before installing the operating system's.

I installed SME9.1 and everything works perfectly. SME automatically detects all 3 NICs (obviously, 2nd and 3rd lack of connectivity).

I need to 'hide' from SME the NICs without connectivity in order to be able to use a a Dummy NIC for the internal interface.

I tried removing them within Centos but after reconfiguration SME  automatically reactivates them. 


Eternal gratitude for help!    :)


the solution:

Here is an approach that might be worth a NFR for it touches 1 line in e-smith-base...

Use at your own risk!

edit /usr/share/perl5/vendor_perl/esmith/console/configure.pm

find the line: if (scalar @adapters == 1)

and change it to:

if (scalar @adapters == 1 || $db->get_value('ForceDummyNic') eq 'enabled')

Now you can toggle the yes/no listing of the Dummy NIC by setting the db key:

config set ForceDummyNic enabled and config delete ForceDummyNic

After setting the db key, you can run console and the dummy NIC will be listed and available to pick as the internal (LAN) adapter only.

HTH
« Last Edit: October 12, 2016, 05:01:25 PM by tomi »

Offline Stefano

  • *
  • 10,839
  • +2/-0
did you try to setup SME using the working NIC as WAN one and one of the other for LAN side?

Offline tomi

  • 11
  • +0/-0
ciao!

yes, I have done so. I want to use dummy interface for LAN side.
« Last Edit: October 08, 2016, 05:45:23 PM by tomi »

Offline Stefano

  • *
  • 10,839
  • +2/-0
I guess it didn't work :-)

what did you try to disable onboard NICs and what kind of tool do you have to interact with your VPS?


Offline Stefano

  • *
  • 10,839
  • +2/-0
just make this test..

at the end of setup, before rebooting, use Alt+F2 (IIRC..) to get a shell
take a look into /etc/udev/rules.d/ (into your virtual hd) if is there a 70-persistent-net.rules file

if so, try to edit it commenting out the rules that are related to the 2 inactive NICs

NOTE: not tested..

Offline tomi

  • 11
  • +0/-0
grazie! provo stasera... ti tengo aggiornato.


Offline Stefano

  • *
  • 10,839
  • +2/-0
tested right now in a VM here.. during setup you can switch to a shell with ALT+F2, cd to /mnt/sysimage/etc/udev/rules.d and edit the file..
unfortunately it doesn't work, meaning that during first setup you still see the real NICs..

you'd try to setup a VM with a single NIC, setup as you prefer (using the same parameters you'd use on the real VPS), then create a backup via the console and finally import that backup during first setup..

just an idea
« Last Edit: October 08, 2016, 07:01:33 PM by Stefano »

Offline Stefano

  • *
  • 10,839
  • +2/-0
grazie! provo stasera... ti tengo aggiornato.



ciao, sorry but english only here.. if you prefer italian language, come to the right forum, thank you

Offline tomi

  • 11
  • +0/-0
Sorry! use my interlocutor's native language was a form of courtesy

guest22

Here is an approach that might be worth a NFR for it touches 1 line in e-smith-base...

Use at your own risk!

edit /usr/share/perl5/vendor_perl/esmith/console/configure.pm

find the line: if (scalar @adapters == 1)

and change it to:

if (scalar @adapters == 1 || $db->get_value('ForceDummyNic') eq 'enabled')

Now you can toggle the yes/no listing of the Dummy NIC by setting the db key:

config set ForceDummyNic enabled and config delete ForceDummyNic

After setting the db key, you can run console and the dummy NIC will be listed and available to pick as the internal (LAN) adapter only.

HTH

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
I don't understand. Why would you want to use a dummy NIC if you have a real one ? Just choose one of the unused NIC, without pluging anything on it, and you'll have the same effect
C'est la fin du monde !!! :lol:

Offline tomi

  • 11
  • +0/-0
I don't understand. Why would you want to use a dummy NIC if you have a real one ? Just choose one of the unused NIC, without pluging anything on it, and you'll have the same effect

one reason, and not the last, is that I like to know how I can combine various procedures in a more complex algorithm, even if the purpose of that algorithm may seem stupid or useless. Maybe in another situation, skills thus acquired may be used in a less stupid way.

However, in this case do not claim that this is the primary reason.

Offline Daniel B.

  • *
  • 1,699
  • +0/-0
    • Firewall Services, la sécurité des réseaux
Re: how to 'hide' the 2th network card on SME v9.1 installation
« Reply #12 on: October 10, 2016, 11:53:06 AM »
Sorry, but I couldn't understand what you mean here. Can you detail the reason not to use one of the real NIC, even if unplugged, as this would have the same effect than using the dummy NIC (support for the dummy NIC was added only for those case where you have a single NIC, and you can't run in server only mode because this single NIC is the public one)
C'est la fin du monde !!! :lol:

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: how to 'hide' the 2th network card on SME v9.1 installation
« Reply #13 on: October 10, 2016, 12:15:12 PM »
I agree with Dani
IOW, explain your problemi/aim, not your solution, thank you

Offline tomi

  • 11
  • +0/-0
@RequestedDeletion

...
Use at your own risk!

edit /usr/share/perl5/vendor_perl/esmith/console/configure.pm
...

already tried modifying (and)this script (in another way), so far without the desired result.

Now I will follow your instructions ...

Thank you very much for your help and willingness.