Page 1 of 1

RTNETLINK answers: No such device

Posted: 1. Feb 2018, 22:28
by bcd
Hi,
I'm using VB 5.2.6, trying to set up a Host-Only network. Host and Guest are both CentOS. In VB, I've set network adapter 1 to the Host-only and adapter 2 to NAT.
I'm attempting to set a fixed IP address 192.168.56.150 on eth0 in the guest.

When I do a "service network restart" all show OK but eth0 gives

Bringing up interface eth0: RTNETLINK answers: No such device.

I may need to configure something on the host but I don't know what.

Can you help?

I did ifconfig -a and route -n on Host and guest.

On the host these showed

Code: Select all

ifconfig -a:
em1       Link encap:Ethernet  HWaddr D4:AE:52:BA:FF:F4
          inet addr:151.236.33.153  Bcast:151.236.33.153  Mask:255.255.255.255
          inet6 addr: fe80::d6ae:52ff:feba:fff4/64 Scope:Link
          inet6 addr: 2a02:af8:fab0:803:151:236:33:153/128 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2975563 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7210763 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:418285446 (398.9 MiB)  TX bytes:10642660923 (9.9 GiB)

em2       Link encap:Ethernet  HWaddr D4:AE:52:BA:FF:F5
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:669290 errors:0 dropped:0 overruns:0 frame:0
          TX packets:669290 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10223053680 (9.5 GiB)  TX bytes:10223053680 (9.5 GiB)

vboxnet0  Link encap:Ethernet  HWaddr 0A:00:27:00:00:00
          inet addr:192.168.56.1  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::800:27ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:12642 (12.3 KiB)

route -n:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
151.236.33.1    0.0.0.0         255.255.255.255 UH    0      0        0 em1
192.168.56.0    0.0.0.0         255.255.255.0   U     0      0        0 vboxnet0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 em1
0.0.0.0         151.236.33.1    0.0.0.0         UG    0      0        0 em1
On the Guest these showed

Code: Select all

ifconfig -a:
eth0      Link encap:Ethernet  HWaddr 08:00:27:0C:BE:AE
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2190 (2.1 KiB)  TX bytes:4031 (3.9 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:4E:82:A9
          inet addr:10.0.3.15  Bcast:10.0.3.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4373 (4.2 KiB)  TX bytes:7539 (7.3 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:264 errors:0 dropped:0 overruns:0 frame:0
          TX packets:264 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:22436 (21.9 KiB)  TX bytes:22436 (21.9 KiB)

route -n :
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.3.0        0.0.0.0         255.255.255.255 U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
0.0.0.0         10.0.3.2        0.0.0.0         UG    0      0        0 eth1
Many thanks.

Re: RTNETLINK answers: No such device

Posted: 2. Feb 2018, 11:11
by socratis
bcd wrote:I'm attempting to set a fixed IP address 192.168.56.150 on eth0 in the guest.
Why?
How?

Re: RTNETLINK answers: No such device

Posted: 3. Feb 2018, 13:04
by bcd
Why?
Because I want to setup a website on the guest using a known, fixed ip address that the host can ping, for example. Then I can access the website directly it from the host.

How?
In /etc/sysconfig/network-scripts/ifcfg-eth0 I have

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.56.150
HWADDR=08:00:27:24:A4:E6
ONBOOT=yes

Re: RTNETLINK answers: No such device

Posted: 4. Feb 2018, 00:28
by socratis
Thank you for the explanation, makes complete sense.

Now, I'm not 100% sure, but I vaguely remember an issue like that with a VM that forced me to delete the whole thing, because of the unorthodox way that it was behaving; it would only allow an active NIC at a time! You would enable #1, the rest would become inactive (I had 4 NICs on the guest). There was a solution out there, and it had nothing to do with VirtualBox. But it really drove me crazy and I dumped the whole VM.

Maybe CentOS is doing the same thing? It's been years since I had a CentOS host (or guest)...

Re: RTNETLINK answers: No such device

Posted: 4. Feb 2018, 13:46
by bcd
OK thanks. If you struggled too it's safe to assume it's difficult or something wierd is going on.

For the record, I have that exact configuration (viz. with 2 NICs) working with a Windows Host and CentOS guest.

Anyway, I've changed some things around to move the problem elsewhere and solved that new problem using NAT with port forwarding.