How to configure the NIC?


#1

Hello,

Yes, I ask this how to configure the NIC? :grin:
But not by the WEBGUI… by the CLI way.

I have a strange behavior, not sure NS is the cause, perhaps a Virtual Box issue:

I’ve got a NethServer instance in a VM on my Mac.
For one reason too long to explain here, I had to change the subnet of my home Network.
It was the 192.168.2.0/24, and now it is 192.168.20.0/24.

The Mac is on the correct network, take is IP by DHCP ( the MicroServer), but when I start the NetServer VM, it still in the old network, nothing abnormal because it’s a fix IP address :smile_cat:
I reconfigure the nic with the CLI, via the Cent OS way…
By editing the /etc/sysconfig/netwok-scripts/ifcfg-eth0

The Nethserver on the actual network ping successfully 8.8.8.8, my gateway… But I still unreachable from the Mac !!!

When I restart the VM… It return to the the old network.

When I change the nic configuration… Is there the database to fix?
How to?


Access Server Manager
(Stéphane de Labrusse) #2
# db networks show
eth0=ethernet
    bootproto=none
    device=eth0
    gateway=192.168.xx.1
    hwaddr=08:00:27:59:91:B4
    ipaddr=192.168.xx.199
    netmask=255.255.255.0
    onboot=yes
    role=green

see http://www.nethserver.org/dokuwiki/doku.php?id=db_command_tutorial for changing property manually


(Filippo Carletti) #3

The developer manual (http://docs.nethserver.org/projects/nethserver-devel/en/latest/network.html) has a complete working example:

db networks set eth0 ethernet role green hwaddr xx:yy:27:DE:B6:51 ipaddr 192.168.1.4 netmask 255.255.255.0 network 192.168.1.0 onboot yes bootproto static

Usually, you only need to set ipaddr, netmask and gateway.


Changing RED<-->GREEN
#4

Okay, it was it’s the e-smith that wasn’t well adjusted… :skull:
@stephdl @filippo_carletti, I successful change the nic configuration.

When I do db networks show, I’ve got now the correct configuration.

From a shell box, on the Mac, I successfully ping the VM.
From the VM, I ping the Mac address.

But from the browser, I don’t access the webgui :smirk:

What do you suggest to adjust?
Edit: when I do
# config show dns
It show a wrong dns server, so it not make a proper dns subscription.

It’s the dns to fix… How to?
Why the https://ip_addr:980 don’t open the webgui?


(Stéphane de Labrusse) #5

which network solution did you use for virtualbox, bridge based or nat based, in this last case you need to do a nat redirection


#6

The king @Ctek said “bridged” :smiley: