解决vagrant启动时需要选择bridged问题

Available bridged network interfaces:

1
2
3
4
5
6
7
8
 vagrant up
-- 中略 --
[default] Available bridged network interfaces:
1) en1: Thunderbolt Ethernet
2) en0: Wi-Fi (AirPort)
What interface should the network bridge to? 1
[default] Preparing network interfaces based on configuration...
-- 後略 --

编辑Vagrantfile文件,找到config.vm.network 修改如下

1
config.vm.network :public_network, :bridge => "en1: Thunderbolt Ethernet"

若需要分配一个静态IP则

1
config.vm.network :public_network, ip: "10.0.3.233" , :bridge => "en1: Thunderbolt Ethernet"