I need to create a VLAN in order to be able to ssh from my macbook to another computer(Comp1). My macbook is connected to this computer(Comp1) peer to peer using ethernet cable.

If this computer(Comp1) was connected to my ubuntu machine, I would have to run the following commands in ubuntu to create a VLAN and subsequently ssh in to the computer(Comp1).

sudo vconfig add en0 3
sudo ip addr add dev en0.3
sudo ip link set up en0.3

Now I want an equivalent of the above commands for macbook. Man page for 'ifconfig' shows me 'vlan' as an option but it doesn't have enough detail for me to infer the command.

Most of the searches I did with regards to "VLAN setup in macbook" I found instructions that showed the way to configure VLAN using the UI. That is: System Preferences -> Network -> (left bottom gear)->Manage Virtual Interfaces -> (+) -> New VLAN... -> set VLAN name, Tag, Interface.

However I can not pick from the "Interface" dropdown list, the dropdown list has nothing to show. So I am not able to pick and consequently I am not able to create the VLAN (see pic)

enter image description here

Therefore this is the main reason why I am looking to find the command line way of creating VLAN in mac.

So in short, since the UI way of creating VLAN is broken for some reason, I want to create VLAN using terminal command on my macbook. How can I do that?

Thank you!

New contributor
Rose is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Rose is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.