3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Oracle Cloud上の仮想マシンへのアクセス許可を追加する

3
Last updated at Posted at 2020-03-28

個人の開発環境でOracle Cloudを利用しているのですが、ネットワークセキュリティグループやセキュリティリスト以外にもiptableにも編集を入れる必要があることがわかったので備忘録がてら残します。

永続化のため、iptablesコマンドではなく、rulesファイルを編集します。

command
sudo vi /etc/iptables/rules.v4

今回は80/tcp, 443/tcpを追加してみました。

rules.v4
~

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [463:49013]
:InstanceServices - [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p udp --sport 123 -j ACCEPT
-A INPUT -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
~

反映させましょう

command
sudo /etc/init.d/netfilter-persistent reload

もちろん追加だけでなく。変更、拒否もできますので、要件に応じて編集しましょう。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?