Bridging vlans across en0 on OSX 10.9

0

1

I'm setting up to run virtual machines to as sample clients with different usage profiles. To do this, the VMs need to run on different vlans to each other, and to the main machine. The switch is configured to do the tagging, I just need to configure my mac to pass the correct packets to the correct VM.

The mac's replacing an old linux box that ran a similar VM/vlan config. In linux, /etc/network/interfaces is set up as follows:

auto eth0
iface eth0 inet dhcp

auto vlan102
iface vlan102 inet manual
    vlan-raw-device eth0

auto br102
iface br102 inet manual
    bridge_ports vlan102
    bridge_maxwait 0
    bridge_fd 0
    bridge_stp off

All I then have to do is set the VM's mac address and tell it to use br102 as the network device. It does DHCP and PXE-boots to the right server based on that.

I have no idea how to set this up on the mac, though. Can it be done, and if so what should I be looking at?

DigitalRaven

Posted 2014-03-12T14:13:37.227

Reputation: 3

I don't know the /etc/network/interfaces format that well, but it sorta looks like you've defined a bridge device with only one interface attached. What sense does that make? – Spiff – 2014-03-12T16:50:24.217

have a look if there is the same file on os x (ls -l /etc/network/interfaces) if so you could use your existing file just keep two points in mind first do a bakup of the already existing file so you can undo if something else stop working and secon the network devices on os x are called enX instead of ethX so in your case you need to change eth0 to en0 – konqui – 2014-03-12T18:36:27.690

@konqui: OSX doesn't use anything like /etc/network/interfaces. If it did, I wouldn't need to ask the question. – DigitalRaven – 2014-03-13T11:18:21.300

@Spiff: The bridge sits on top of the vlan interface and strips the tags so the guest doesn't handle vlan tagging (which is necessary at build time in our infrastructure). – DigitalRaven – 2014-03-13T11:27:36.943

Answers

2

You can create VLAN virtual interfaces via the GUI in System Preferences > Network > [gear icon menu at bottom of interface list] > "Manage Virtual Interfaces" (Or something similar. You'll figure it out.)

You can also set up VLAN interfaces and bridge devices via ifconfig.

Spiff

Posted 2014-03-12T14:13:37.227

Reputation: 84 656

I think I was trying to be too clever for my own good. I re-read the ifconfig manpage and have got it working (well, have got a different problem, but it's officially Someone Else's Problem so I'm happy). – DigitalRaven – 2014-03-13T11:41:46.520