TiDB dashboard With Grafana v5.x or later, we can use provisioning feature to statically provision datasources and dashboards. No need to use scripts to configure Grafana.
sudo ip addr add 10.0.0.1/24 dev tun0 sudo ip linkset tun0 up
远程:
1 2
sudo ip addr add 10.0.0.2/24 dev tun0 sudo ip linkset tun0 up
(3) 测试连通性
1
ping 10.0.0.2 # 从本地 ping 远程隧道 IP
5. 高级用法:自动化配置
在 SSH 配置文件中添加 LocalCommand,自动完成 IP 分配:
1 2 3 4 5 6
Host my-tunnel-host HostName remote-server.com User root Tunnel 0:0 PermitLocalCommand yes LocalCommand sudo ip addr add 10.0.0.1/24 dev tun0 && sudo ip linkset tun0 up
# 限制 VPN 用户权限 Match User vpn-tunnel AllowTcpForwarding no # 禁用端口转发 PermitTunnel yes# 允许创建隧道 ForceCommand /bin/false # 禁止执行任何命令 AuthenticationMethods publickey PermitRootLogin no X11Forwarding no AllowAgentForwarding no