Mac無法連接NAT虛擬機(jī),需要配置DNS網(wǎng)段

問題

  1. 無法ping通NAT網(wǎng)段為172.16.1.x的虛擬機(jī)

解決方案

  1. 查看/etc/resolv.conf中網(wǎng)段配置,修改nameserver為172.16.1.1即可
panzhijie-mac:~ panzhijie$ cat /etc/resolv.conf 
#
# macOS Notice
#
# This file is not consulted for DNS hostname resolution, address
# resolution, or the DNS query routing mechanism used by most
# processes on this system.
#
# To view the DNS configuration used by this system, use:
#   scutil --dns
#
# SEE ALSO
#   dns-sd(1), scutil(8)
#
# This file is automatically generated.
#
nameserver fe80::1xx5:76xx:502e:60
nameserver 172.20.10.1 #修改nameserver為172.16.1.1即可
  1. 測試ping命令是否連通
panzhijie-mac:~ panzhijie$ ping 172.16.1.10
PING 172.16.1.10 (172.16.1.10): 56 data bytes
64 bytes from 172.16.1.10: icmp_seq=0 ttl=64 time=0.379 ms
64 bytes from 172.16.1.10: icmp_seq=1 ttl=64 time=0.518 ms
64 bytes from 172.16.1.10: icmp_seq=2 ttl=64 time=0.522 ms
64 bytes from 172.16.1.10: icmp_seq=3 ttl=64 time=0.508 ms
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容