0

puphpet を使用してプロビジョニングされた vagrant ボックスで livereload ブラウザー拡張機能を使用しようとしています。

ホストOS(OSX)からそのポートにtelnetできないため、ポート35729がブロックされていると思います。ゲスト OS は 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'
4

1 に答える 1

0

Adding the ports under the forwarded_port should be enough, as I've written code into PuPHPet to add those to the OS firewall:

if has_key($vm_values, 'vm')
  and has_key($vm_values['vm'], 'network')
  and has_key($vm_values['vm']['network'], 'forwarded_port')
{
  create_resources( iptables_port, $vm_values['vm']['network']['forwarded_port'] )
}

define iptables_port (
  $host,
  $guest,
) {
  if ! defined(Firewall["100 tcp/${guest}"]) {
    firewall { "100 tcp/${guest}":
      port   => $guest,
      proto  => tcp,
      action => 'accept',
    }
  }
}

However, you must run $ vagrant reload, not $ vagrant provision. Reload affects the box itself - memory, cpus, ports shared, etc. Provision will affect whatever provisioning script you've set up (in this case Puppet).

于 2015-02-10T17:44:52.800 に答える