TransWikia.com

networking with one NIC and access to internet and virtual machines

Server Fault Asked by kon psych on December 5, 2021

I have installed opennebula and I have followed this tutorial.
Unfortunately I cannot ssh to the virtual machines that appear to be in a running state and already have an IP.
The problem might be that I have one NIC and although I read that I should use bridging I am not sure if this is possible and how.

brctl show command output is

bridge name    bridge id            STP enabled    interfaces
br0            8000.50e549b5e2aa    no             eth0
                                                   vnet0
virbr0         8000.000000000000    yes       

vnet0 is the interface of the VM. If I construct a VM to use the virtual bridge virbr0 I have the same problem.

my interfaces file is

iface br0 inet static
address X.X.X.172
netmask 255.255.255.0
gateway X.X.X.200
pre-up ifconfig eth0 down
pre-up brctl addbr br0
pre-up brctl addif br0 eth0
pre-up ifconfig eth0 up
post-down ifconfig eth0 down
post-down brctl delif br0 eth0

iface eth0 inet manual

In ifconfig br0 has been assigned the IP defined in interfaces (which is public) while vnet0 appears to send data (TX bytes > 0) but never receive (RX bytes = 0).
Am I missing something? Is it possible to ssh to a VM having one NIC or I need to have a second one?

One Answer

What OpenNebula assumes in its documentation here is that the hosts use two physical interfaces one for private network and one for internet connectivity. Of course if a host has only one interface it can connect to only one of the networks. The solution I tried so that do not lose internet connectivity was to change interfaces file so that the br0 interface is automatically assigned IP by DHCP

iface br0 inet dhcp

I also changed network definition file so that it contains leases of public IP addresses that were not assigned by dhcp. The virtual machine I instantiated was successfully assigned a public IP. Although I was able to ssh to that virtual machine then so can anybody on the internet so I am not going to keep this configuration.

Answered by kon psych on December 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP