The place I’m currently working has an IP telephony system. Each phone has an extra LAN port which you can plug a laptop into.

All very handy, but the port is trunked so plugging my Apple Powerbook 12″ into it doesn’t result in any sort of useful connection.

Googling around indicates that only OS X Server (10.3.3 onwards) has a GUI tool for configuring VLANs on an Ethernet port. The OS X client that you get on your iBook, iMac, Powerbook and PowerMac as standard doesn’t have anything obvious for VLAN support.

Digging further reveals that the standard Terminal ifconfig does support VLAN commands.

sudo ifconfig vlan0 create
sudo ifconfig vlan0 vlan VLAN-TAG vlandev en0
sudo ipconfig set vlan0 DHCP

The first line creates the VLAN pseudo device vlan0, the second line that connects that device to the physical ethernet port (in this case en0) and tells the machine which VLAN tag to use.

You will need to replace VLAN-TAG with the relevant VLAN tag which your network administrator should be able to supply you with.

The third line sets the vlan0 pseudo device to use DHCP. If you need to set up a static IP address use something along the following two lines instead:-

sudo ifconfig vlan0 inet 192.168.0.10 netmask 255.255.255.0

and then

sudo route add default 192.168.0.1

to set your default gateway.

When you've finished with the VLAN connection you can destroy the pseudo-device with:-

sudo ifconfig vlan0 destroy

The Ethernet port in my Powerbook 12" (2005 model) supports VLANs, and I suspect the ports on most recent Macs will be the same.