50% off 全プラン、期間限定。料金は $2.48/mo
Security

Check cloud vps firewall

By Parnian R. 4 min read Updated Feb 15, 2026

Troubleshooting connectivity issues on a Cloud Virtual Private Server
(VPS) では、ファイアウォール設定の確認と調整が必要になることがよくあります。
properly configured firewall is essential for maintaining optimal
セキュリティを維持しつつ、サービスの可用性も確保する方法についてのこの記事
provides a comprehensive guide on how to manage and troubleshoot your
VPS’s firewall settings for improved connectivity.

Prerequisites

ファイアウォールのトラブルシューティング手順に進む前に、以下を確認してください
meet the following prerequisites:

  1. Sudo Privileges: You should have sudo privileges
    VPS で管理コマンドを実行する場合。

  2. Basic Firewall Knowledge: Familiarity with basic
    ファイアウォールの概念とコマンド。UFW (Uncomplicated) に特化した内容
    このガイドで使用しているファイアウォール)。

  3. SSH Access: Ensure you have SSH access to your
    VPS for remote command execution.

  4. Updated System: Your VPS should be running an
    up-to-date version of its operating system for security and
    互換性があります。システムを更新するには、VPS にログインして、以下のコマンドを実行してください
    two commands:

sudo apt update && sudo apt upgrade.

Step 1: Check Firewall
Status

  1. Check the firewall status:

まずは次のコマンドでファイアウォールの現在の状態を確認してください。

sudo ufw status

This command will display whether the firewall is active and show any
existing rules.

  1. Activate Firewall If Inactive:

ファイアウォールがアクティブでない場合は、有効にする必要があります。その前に
そのため、SSH接続がロックされないように許可されていることを確認してください
out:

sudo ufw allow ssh
sudo ufw enable

These commands will allow SSH connections through the firewall and
then activate it.

This step is crucial to ensure that your firewall is running and
configured correctly for initial diagnosis.

Step 2: Review
and Modify Firewall Rules

  1. List Current Firewall Rules:

現在のファイアウォールルールをすべて番号付きで表示するには、以下を実行してください:

sudo ufw status numbered
List Firewall Rules

This command provides a clear overview of all the rules and their
sequence.

  1. Allowing a Specific Port:

特定のポートのトラフィックを許可するには、以下を実行してください:

sudo ufw allow [port_number]

Replace [port_number] with the actual port number
you wish to open.

  1. Denying a Specific Port:

特定のポートのトラフィックをブロックするには、以下を使用します:

sudo ufw deny [port_number]

Replace [port_number] with the port number you want
to close.

  1. Deleting a Specific Rule:

ルールを削除するには、リストからそのルール番号を確認してから、以下を実行してください。

sudo ufw delete [rule_number]

Replace [rule_number] with the number corresponding
削除したいルールを選択してください。

  1. Recheck Updated Rules:

変更を加えた後、更新されたルールを以下のコマンドで確認してください:

sudo ufw status

ファイアウォールルールを必要に応じて確認・変更することで、
VPS との間のトラフィックフローを管理し、潜在的な問題に対処する
connectivity issues.

Step 3: Test
Connectivity

  1. Test Service Connectivity:

ウェブサービスの場合、ブラウザでウェブサイトにアクセスするか、
a command like: curl http://your_website.com.

-SSH の場合、次でコネクションをテストしてください ssh
username@your_vps_ip
.

FTP サービスの場合、FTP クライアントまたはコマンドを使用して接続してみてください
line: ftp your_vps_ip.

  1. Verify Access to Allowed Ports:
  • 特定のポートにアクセスできるか確認するには、telnetを使用できます
    command: telnet your_vps_ip port_number.

  • 例えば、ポート 80 で Web サーバーをテストする場合: telnet
    your_vps_ip 80
    .

  1. ブロック済みサービスのポート確認:
  • 拒否されたポートへの接続がブロックされていることを確認してください。次に試してください。
    ブロックされたポートのサービスに接続すると、接続に失敗するはずです。

  • たとえば、ポート 8080 をブロックしている場合、以下を使用してテストできます
    telnet your_vps_ip 8080 should not succeed.

Including these command examples provides a practical approach to
ファイアウォール設定の有効性を検証しています。

Step 4:
追加のトラブルシューティング

  1. Verify Service Status:

ウェブサーバーなど、アクセスしようとしているサービスが正しく動作していることを確認してください
(apache2, nginx) またはデータベース (mysql) が稼働しているか確認してください。以下のようなコマンドを使用します
sudo systemctl status apache2 to check their
status.

  1. Check for IP Restrictions:

Make sure no IP-based restrictions are set in the firewall that might
誤ってアクセスをブロックすることがあります。以下で確認できます sudo
ufw status
.

  1. Review Logs for Clues:

Check server logs for any error messages or clues related to
接続の問題が発生しています。Apache の場合は、以下を確認してください
/var/log/apache2/error.log.

Review Logs for Clues
  1. Use Network Diagnostic Tools:
  • Ping: Test network connectivity to your server
    (ping your_server_ip).

  • Traceroute: Trace the path packets take to your
    server (traceroute your_server_ip)。このコマンドはネットワークの経路を確認するのに役立ちます
    where connectivity issues occur along the route.

  • Netstat: Display network connections and
    リッスンポート (netstat -plntu)。どのサービスが実行されているかを確認するのに便利です
    listening on which ports.

  • Nmap: Scan for open ports to verify if the
    firewall rules are correctly applied (nmap your_server_ip).

These additional steps and tools can help you diagnose and resolve
more complex connectivity issues.

You now know everything about connectivity troubleshooting. If you
ご質問やご不明な点がありましたら、以下の方法でお気軽にお問い合わせください submitting a
ticket
!

Share

Need help with something else?

Median response time under 1 hour. Real humans, not bots.