在中国使用 Google Home Mini

上周从ビックカメラ带回来一台 Google Home Mini,在中国正常使用还需要额外的设置,在此记录之。


先介绍当前网络环境,所有系统均为虚拟机运行在一台物理机上:

  • 路由器系统为 OpenWrt(1C128M),使用 Dnsmasq 负责 DHCP
  • 旁路由系统为 Ubuntu(2C4G),运行 clash,使用 enhanced mode 作为代理。

需要代理的设备可以通过 DHCP 指定 Ubuntu 作为网关

clash 部分配置如下:

redir-port: 7892
allow-lan: true
dns:
  enable: true
  enhanced-mode: fake-ip
  ipv6: false
  listen: 0.0.0.0:53
  nameserver:
  - 114.114.115.115
  - 119.28.28.28
  - 223.6.6.6

由于 Google Home Mini 系统 hard code 了 Google DNS 作为 DNS server,这里需要把 Google DNS 路由黑洞,Google Home Mini 会回落到 DHCP 分配的 DNS server。

iptables-save 的输出如下:

# Generated by iptables-save v1.6.1 on Sun Feb  2 17:48:08 2020
*filter
:INPUT ACCEPT [904556:754072678]
:FORWARD ACCEPT [1547:315368]
:OUTPUT ACCEPT [665899:761555014]
COMMIT
# Completed on Sun Feb  2 17:48:08 2020
# Generated by iptables-save v1.6.1 on Sun Feb  2 17:48:08 2020
*nat
:PREROUTING ACCEPT [3358:336587]
:INPUT ACCEPT [3015:295280]
:OUTPUT ACCEPT [2599:165903]
:POSTROUTING ACCEPT [2655:174160]
:clash - [0:0]
-A PREROUTING -d 8.8.8.8/32 -j DNAT --to-destination 255.255.255.255
-A PREROUTING -p tcp -j clash
-A clash -d 10.0.0.0/16 -j RETURN
-A clash -p tcp -j REDIRECT --to-ports 7892
COMMIT
# Completed on Sun Feb  2 17:48:08 2020
# Generated by iptables-save v1.6.1 on Sun Feb  2 17:48:08 2020
*mangle
:PREROUTING ACCEPT [910994:754769381]
:INPUT ACCEPT [904561:754072938]
:FORWARD ACCEPT [1547:315368]
:OUTPUT ACCEPT [666124:761583461]
:POSTROUTING ACCEPT [675135:764718083]
COMMIT
# Completed on Sun Feb  2 17:48:08 2020
  • 8.8.8.8 为 Google DNS 地址
  • 10.0.0.0/16 为内网地址
  • 7892 为 clash redir-port
shadowsocks Domotics
Some rights reserved
Except where otherwise noted, content on this page is licensed under a Creative Commons Attribution-ShareAlike 4.0 International license