FreeBSD 监狱的仅主机网络
我继承了一个环境,其中有多台运行监狱的 FreeBSD6.1 机器。
由于本地网络上的 IP 耗尽,我想更改监狱,以便物理网络上有 1 个可路由的 IP,而监狱之间有另一个不可路由的虚拟网络。
这实际上可以实现吗?到目前为止,我的研究表明,监狱有自己的地址绑定到主机上的网络接口;我一直无法找到有关虚拟网络接口的任何信息。
我想确保我的监狱 IP 地址没有 ARP 流量,因为对监狱的所有访问都将通过主机上的 SSH(或通过主机的 netcat/ssh 代理)进行。
任何有关实施这一点的指导将不胜感激。
I have inherited an environment with multiple FreeBSD6.1 machines running jails.
Due to IP exhaustion on the local network, I want to change the jails so that there is 1 routable IP on the physical network, and another non-routable virtual network between the jails.
Is this actually achievable? My research so far indicates that a jail has it's own address bound to a network interface on the host; I haven't been able to find any information on virtual network interfaces.
I want to ensure that there is no ARP traffic for my jail IP addresses, as all access to the jails will be via SSH on the host (or netcat/ssh proxying via the host).
Any guidance on implementing this would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需向 lo0 添加别名并为每个监狱提供 127/8 中的地址即可。例如,127.0.0.2、127.0.0.3、...、127.255.255.254。
然后您可以根据需要进行代理或进行 NAT。
更新,差不多一年后:
如果您升级到 FreeBSD 8 或更高版本,您还可以使用 epair(4) 在两个监狱实例之间创建虚拟网络接口。您可以将其与 if_bridge 结合起来创建一个与您想要做的完全一样的虚拟网络。
Just add aliases to lo0 and give each jail an address in 127/8. For example, 127.0.0.2, 127.0.0.3, ..., 127.255.255.254.
You can then proxy or do NAT as required.
Update, almost a year later:
If you upgrade to FreeBSD 8 or higher you can also use epair(4) to create a virtual network interface between two jail instances. You can combine this with if_bridge to create a virtual network exactly as you are trying to do.
为了快速而肮脏的修复,您还可以在盒子前面放置一个路由器(带有新的子网),然后将路由器的 DMZ 设置为服务器的新 IP 地址。
For a quick and dirty fix, you could also stick a router in front of the box (with a new subnet) and then set the router's DMZ to the server's new IP address.