MENU

谁在用mac的utun接口?!

• April 12, 2025 • 真 ·乱写

前几天在终端运行ifconfig时发现,竟然有多达五个utun接口

经过有关资料查询,

utun is a virtual interface created by an application on macOS endpoints to interact with the system
utun是一种虚拟网络接口,用于建立安全的隧道连接,在VPN等应用中广泛使用。数字表示创建的不同utun接口的编号。
utun是用户级隧道接口。这些接口通常用于创建VPN连接或其他类型的网络隧道。

节选:

utun4: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
    inet6 fe80::9d4d:9dda:8bb0:7aec%utun4 prefixlen 64 scopeid 0x13 
    nd6 options=201<PERFORMNUD,DAD>

这里的inet6 fe80::9d4d:9dda:8bb0:7aec%utun4 prefixlen 64 scopeid 0x13是接口的IPv6本地地址,用于在本地网络中通信。nd6 options=201<PERFORMNUD,DAD>是IPv6的一些选项,PERFORMNUD表示执行无地址状态的邻居发现,DAD表示执行重复地址检测。

于是对utun4接口进行探索,在火绒剑中可以看到,identityservicesd.app在使用这个ipv6链路本地地址

接着,在LuLu中禁止identityservicesd的传出连接。再运行ifconfig,发现又出现了两个utun接口,为utun6和utun7。这时终端执行命令log show --last 2h --predicate 'eventMessage contains "utun"' --info,可以看到:

identityservicesd: (NetworkExtension) [com.apple.networkextension:] Created a new NEVirtualInterface "utun6" (85B12F7F-...5-70D277FDE142)

可以明确看到,identityservicesd创建了utun6接口

后来,identityservicesd又创建了utun7接口

identityservicesd: (NetworkExtension) [com.apple.networkextension:] Created a new NEVirtualInterface "utun7" (D1B03D14-...595BB988)

由于我暂时禁止了它的传出连接,日志中反复出现错误信息,几秒一次

identityservicesd: [com.apple.Transport:UTun-oversized] 
legacy control channel connect ready {socket:9}, 
socket error: 9 (Bad file descriptor)

这样,就可以知道确实是identityservicesd在创建并使用一些utun接口了,不存在恶意软件的风险。但是我的疑问是,仍然不知道其他utun接口是用来干什么的,并且为什么要创建utun接口?因为看到资料大部分显示utun接口和VPN服务有关。

(本人技术水平有限,发此文只是为了阐释一些心中的疑惑,勿喷)

引用,参考:

https://blog.csdn.net/wj617906617/article/details/143323145
https://cloud.tencent.com/developer/ask/sof/104984656
https://discussions.apple.com/thread/255645034?sortBy=rank
https://blog.csdn.net/Soul_Programmer_Swh/article/details/132183326
https://apple.stackexchange.com/questions/427100/how-to-find-out-which-applications-are-creating-utun-interfaces

封面主图:日本北海道洞爷湖町洞爷湖

流年轻迹个人博客 -乱写 2023-2025