1

Okay so I have a second 1 gig NIC (PCI-e card) my first is my on board 1 gig NIC, but anyways I would like to have my second NIC for just my kvm VMs but I cant seem to get it working with macvtap or even bridging my second NIC. Every time I start the install of a guest Ubuntu OS I can never get it too contact the internet to finish the install. I would like to be able to use Macvtap but I cant seem to find any documentation for setting it up, so I would just like to try to get a bridge up an running for my VMs to use.

Below is a my /etc/network/interfaces file:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface (On board 1Gb/s NIC)
auto eth0
iface eth0 inet static
       address 192.168.0.12
       netmask 255.255.255.0
       gateway 192.168.0.1
       dns-nameservers 192.168.0.1

# The secondary network interface (HIRO PCI-E card 1 Gb/s)
#auto eth1
#iface eth1 inet manual

# The bridge interface for my VMs
auto vmbr0
iface vmbr0 inet static
            address 192.168.0.11
            netmask 255.255.255.0
            gateway 192.168.0.1
            dns-nameservers 192.168.0.1
            bridge_ports eth1
            bridge_stp off
            bridge_fd 0
            bridge_maxwait 0

So now with this set up I get the bridge up a working but when I connect my VM to it with --network bridge:vmbr0 I get into my install and start going through it but then I get hit by a brick wall when its trying to set up the network in the VM. I can get pas this by manually setting up the network stuff but then I cant reach out to the Ubuntu archive when it wants too then I'm again at a halt in the install process.

If it helps here is the command that I use for virt-install:

sudo virt-install \
--name vm01 \
--vcpus=2 \
--ram=2048 \
--disk vol=vms/vm01 \
--network bridge:vmbr0 \
--graphics none \
--console pty,target_type=serial \
--location 'http://us.archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/' \
--extra-args 'console=ttyS0,115200n8 serial'

The reason I don't use vnc is because I like that I can do everything from my terminal via SSH.

TL:DR - need to get my second NIC working for my VMs, I think I get it going but then when I'm in my install process for the Guest OS i get stuck when it tries to reach outside on the network. Is there something I'm missing something or a guide to follow? Any help would be completely awesome thank you.

4
  • I'd recommend switching to systemd-networkd and getting rid of NetworkManager for 2 physical interfaces because in my experience that's the best way. The package targets exactly that. manpages.ubuntu.com/manpages/wily/man5/systemd.netdev.5.html (look up tutorials because it's complicated at first) Then, I'd recommend physical bridging for your VM's, because it's simpler as all of your machines will then appear on the same subnet. Guide for physical host bridging with systemd-networkd: major.io/2015/03/26/… Jun 12, 2017 at 2:21
  • Seems you have no forwarding between the two NICs .. search for "IP forwarding between two interfaces" and if needed "iptables forward rules for two interfaces" and finally you need to NAT MASQUERADE in Postrouting for input interface vmbr0 and output interface eth1
    – derHugo
    Jun 12, 2017 at 13:02
  • Okay so why do I need the forwarding between the two NICs when I really don't want the host to use the second NIC just the on board one and leave the second one to just my guest OS's? And so nat masquerade what she exactly does that do for me, isn't it used for dynamic ip and what not? Sorry for the newbish questions I'm just kinda getting into the networking side
    – ichi
    Jun 13, 2017 at 22:09
  • I want both NICs to be completely separate so i want my host NIC to have 192.168.0.12 and i want my second NIC that the guest virtual machines run on to be 192.168.0.11. I want them independent of each other, and I don't want them to share an IP.
    – ichi
    Jun 13, 2017 at 23:24

0

You must log in to answer this question.