设置:
一个运行 OpenVPN 服务器和几个 Vagrant 虚拟机的盒子
问题:
我想像普通机器一样直接从 VPN 客户端访问 Vagrant 盒子,而不仅仅是在几个转发端口上。
配置:
OpenVPN 有接口 tun0:
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.69.69.1 P-t-P:10.69.69.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:110348 errors:0 dropped:0 overruns:0 frame:0
TX packets:89923 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:18322866 (18.3 MB) TX bytes:16651955 (16.6 MB)
Run Code Online (Sandbox Code Playgroud)
Vagrant 配置了具有特定 ip 的 public_networks:
config.vm.network "public_network", :bridge => "tun0", ip:"10.69.69.101", :auto_config => "false", :netmask => "255.255.255.0"
Run Code Online (Sandbox Code Playgroud)
但它不起作用,我猜是因为我无法将 Vagrant 桥接到 OpenVpn 接口?。从日志:
DEBUG network: Normalized configuration: …Run Code Online (Sandbox Code Playgroud) 目前,libvirt 中只有两个与网络引导相关的选项可用bootp:
server和file
所以对于这样的配置:
<bootp file='test.ipx' server='10.10.10.2'/>
Run Code Online (Sandbox Code Playgroud)
生成此代码:
dhcp-boot=test.ipx,,10.10.10.2
Run Code Online (Sandbox Code Playgroud)
1)我如何添加这样的东西:
dhcp-userclass=set:ipxe,iPXE
dhcp-boot=tag:ipxe,http://matchbox.foo:8080/boot.ipxe
Run Code Online (Sandbox Code Playgroud)
2)或者我可以将配置文件更改var/lib/libvirt/dnsmasq/default.conf为其他内容
选项 1 似乎不可能查看libvirt 代码。
选项 2 似乎也不可能