# Moving from VMWare

## cdosrun

I would be grateful for some pointers please.

I am no expert, just tinker for fun, but I have a server I have setup at home running Gentoo with the following guests - 5 Gentoo, a Ubuntu and one Kerberos/LDAP appliance. They perform the usual functions of DHCP/DNS/SMTP/IMAP/RADIUS/VPN/Firewall etc. but I have realised that I will now need to move away from VMWare Server with its inability to compile against version 3 of the kernel.

The server is running a quad core Intel Core 2 processor so KVM seems like the way to go but I am really confused about how to migrate the virtual networking setup and would really appreciate guidance from someone more knowledgeable.

The server is headless and sits in the loft with a UPS. It is running kernel RAID and LVM with the VMs in different LVMs and the NFS shares to the guests (that in some cases are then shared on by SMB).

The server has a quad port gigabit card as well as its onboard interface and there are 2 or 3 gigabit links to a managed Linksys switch by LACP. The trunk has about a number of VLANs on it (ideal use set out below but current setup is less clearly defined):

1 - Internal LAN

2 - PPPoE to ADSL/Ethernet bridge

3 - Servers

4 - DMZ

5 - Wireless - SSID1

6 - Wireless - SSID2

The Gentoo firewall guest is presented with all of these VLANs on its virtual cards and I run shorewall for both IPv4 and IPv6. Assuming the move to KVM, how will I arrange the networking to enable the guests to connect to each of the relevant VLANs? For my current setup, I have enabled the VLANs on the host (with no IP addresses except where required) and then used the VMWare setup script to assign virtual networks to each of the VLANs. I understand I will need to setup bridges for the KVM networks but would really appreciate some hints for this in my type of setup with VLANs over a trunk.

I am keen to avoid having the system offline for too long for tinkering because the SMTP server is currently my only valid MX and it has taken me a long time to get the system setup as I want it.

I know I am not reinventing the wheel, but it does feel like it a bit.

Thank you,

Andrew

----------

## nativemad

Hi, 

Just make a bridge for every vlan (i guess these aren't tagged vlans!?) and add the appropriate eth device of the host to it.

Add the VM's tap devices to the right bridges and you're done!   :Wink: 

But if you haven't got any experience with bridges and kvm, i would probably test things out a bit on another computer before messing around with your server...

btw... that is not that uncommon...  this host only has an ip bound on br0 directly   :Razz: 

```

# brctl show

bridge name     bridge id               STP enabled     interfaces

br0             8000.20cf30580cc8       no              eth0

                                                        tap0

                                                        tap1

                                                        tap10

                                                        tap3

br1             8000.20cf30580cc7       no              eth1

                                                        tap2

                                                        tap7

                                                        tap8

br2             8000.0050b6507f08       no              eth2

                                                        tap100

                                                        tap101

br3             8000.26968b0feb5e       no              eth3

                                                        tap200

                                                        tap201

                                                        tap202

                                                        tap203

                                                        tap204

                                                        tap207

                                                        tap208

                                                        tap209

br4             8000.0ed33f3006a9       no              tap301

                                                        tap302

                                                        tap303

                                                        tap304

                                                        tap305

                                                        tap306

                                                        tap307

                                                        tap308

                                                        tap309

# cat /etc/conf.d/net | grep -e tap309 -e br4 #just as example how the tuns and bridges are configured...

tuntap_tap309="tap"

config_tap309="null"

tunctl_tap309="-u kvmuser"

bridge_br4="tap301 tap302 tap303 tap305 tap306 tap307 tap308 tap309"

config_br4="null"

```

Hope that helps a bit... just ask if you have further questions...

Cheers!

----------

## cdosrun

Mr Mad,

Thank you for that, much appreciated. The VLANs are tagged on egress through the LACP connection but the guests are running untagged connections to the host - I presume there will not be a problem with bridging the vlan interfaces on the host with TAP interfaces (is this very much what VMWare does anyway?). My /etc/conf.d/net file is below.

I will try to have a play this evening with my laptop to see if I can boot up one of the guests on a VLAN.

Thanks again.

Andrew

```

/etc/conf.d/net

config_eth0="null"

config_eth1="null"

config_eth2="null"

config_eth3="null"

config_eth4="null"

slaves_bond0="eth1 eth2"

config_bond0="null"

mtu_bond0=9000

vlans_bond0="1 2 3 4 5 6 7 8 9 10 11 12 13 333 666"

vlan1_name="vlan1"

config_vlan1="null"

vlan2_name="vlan2"

config_vlan2="null"

vlan3_name="vlan3"

config_vlan3="[IPADDR]"

mtu_bond0_3="9000"

routes_vlan3="default via [IPADDR]"

#config_vlan3="null" )

vlan4_name="vlan4"

config_vlan4="null"

```

----------

## nativemad

whoo... honestly i don't know if it works with vlan interfaces!? It doesn't with alias interfaces.....  

Maybe you'll have to bridge the bond device and do the tagging within the vms!?

The bridge is on layer2 and vlans/aliases layer3.... but give it a try i would say, as vlan's could maybe act more like real interfaces than aliases!?

good luck

----------

## papahuhn

Hi,

VLANs are not layer 3. I am pretty confident that brctl will work with vconfig interfaces. I once have bridged VMware Workstation's vmnet-Interfaces with eth0.X vconfig-interfaces using VMware's vmnet-bridge tool, and that worked well.

----------

## nativemad

You are absolutely right papahuhn! That should work!   :Razz:   Thanks for the intervention!

sorry, that happens if someone is too lazy to ask a friendly search engine...   :Wink: 

----------

