我正在尝试将 livereload 浏览器扩展与使用 puphpet 配置的 vagrant box 一起使用。
我认为端口 35729 被阻止,因为我无法从主机操作系统(OSX)远程登录到该端口。来宾操作系统是 Ubuntu 14.04。
添加一个 IPTables 规则就足够了,还是我需要添加一个新的转发端口并重新配置该框?
iptables -L
target prot opt source destination
ACCEPT icmp -- anywhere anywhere /* 000 accept all icmp */
ACCEPT all -- anywhere anywhere /* 001 accept all to lo interface */
ACCEPT all -- anywhere anywhere /* 002 accept related established rules */ state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere multiport ports 1025,socks /* 100 tcp/1025, 1080 */
ACCEPT tcp -- anywhere anywhere multiport ports ssh /* 100 tcp/22 */
ACCEPT tcp -- anywhere anywhere multiport ports https /* 100 tcp/443 */
ACCEPT tcp -- anywhere anywhere multiport ports http /* 100 tcp/80 */
DROP all -- anywhere anywhere /* 999 drop all */
我尝试添加以下内容:
sudo iptables -A OUTPUT -p tcp -m tcp --dport 35729 -j ACCEPT
sudo iptables -A INPUT -p tcp -m tcp --sport 35729 -j ACCEPT
但这并没有解决问题。我还尝试将其添加到 config.yml 并运行vagrant provision
:
forwarded_port:
l1J8zgpT2xBX:
host: '35729'
guest: '35729'