Mac OS X 中的虚拟网络接口 [英] Virtual network interface in Mac OS X

查看:46
本文介绍了Mac OS X 中的虚拟网络接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道您可以在 Windows 中创建虚拟网络接口(请参阅此处),并且在 Linux 中,使用 ip-aliases 也很容易,但是 Mac OS X 是否存在类似的东西?我一直在寻找环回适配器、虚拟接口,但找不到好的解决方案.

I know that you can make a virtual network interface in Windows (see here), and in Linux it is also pretty easy with ip-aliases, but does something similar exist for Mac OS X? I've been looking for loopback adapters, virtual interfaces and couldn't find a good solution.

您可以在网络面板中基于现有接口创建新接口,但它不会充当真正的全功能接口(如果原始接口处于非活动状态,则派生接口也处于非活动状态).

You can create a new interface in the networking panel, based on an existing interface, but it will not act as a real fully functional interface (if the original interface is inactive, then the derived one is also inactive).

在完全断开连接的情况下工作时需要此方案.即便如此,在 VMWare 安装中运行服务器时具有网络功能也是有意义的.这些虚拟机可以通过它们的 IP 地址访问,但不能通过它们的 DNS 名称访问,即使我在其中一台虚拟机中运行 DNS 服务器也是如此.通过配置一个接口来使用虚拟 DNS 服务器,我想我可以测试一些 DNS 场景.不幸的是,如果没有一个接口处于非活动状态,则没有接口解析 DNS 名称...

This scenario is needed when working in a completely disconnected situation. Even then, it makes sense to have networking capabilities when running servers in a VMWare installation. Those virtual machines can be reached by their IP address, but not by their DNS name, even if I run a DNS server in one of those virtual machines. By configuring an interface to use the virtual DNS server, I thought I could test some DNS scenario's. Unfortunately, no interface is resolving DNS names if none of them are inactive...

推荐答案

环回适配器始终开启.

ifconfig lo0 alias 172.16.123.1 会将别名 IP 172.16.123.1 添加到环回适配器

ifconfig lo0 alias 172.16.123.1 will add an alias IP 172.16.123.1 to the loopback adapter

ifconfig lo0 -alias 172.16.123.1 将删除它

这篇关于Mac OS X 中的虚拟网络接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆