‘juju status -e maas --debug’ 显示连接被拒绝

‘juju status -e maas --debug’ 显示连接被拒绝

尝试查询环境状态时出现以下错误。

juju status --debug
2016-03-31 09:44:05 DEBUG juju.api apiclient.go:337 error dialing "wss://10.1.0.11:17070/environment/b61d8832-5b0a-43cd-8447-c70b33caf157/api", will retry: websocket.Dial wss://10.1.0.11:17070/environment/b61d8832-5b0a-43cd-8447-c70b33caf157/api: dial tcp 10.1.0.11:17070: connection refused

答案1

我通过向 iptables 添加规则解决了这个问题

  sudo sysctl -w net.ipv4.ip_forward=1

iptables -A FORWARD -i <interface without internet> -o <interface with internet> -j ACCEPT

iptables -A FORWARD -i <interface with internet> -o <interface without internet> -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -t nat -A POSTROUTING -o <interface with internet> -j MASQUERADE

相关内容