Other

Port Forwarding Setup: A Step-by-Step Guide for Beginners

This guide will help you set up port forwarding on your home router to make local services accessible from outside. You'll get clear steps for most routers and operating systems.

Updated at February 16, 2026
10-15 min
Easy
FixPedia Team
Применимо к:Any router with a web interfaceWindows 10/11Ubuntu 22.04 LTSmacOS 12+

Introduction

Port forwarding is a router function that allows you to redirect incoming internet traffic from a specific port to a particular device on your local network. Without this configuration, devices inside the network are protected by a firewall and are not visible from the outside. Using port forwarding, you can, for example, enable access to a home server, gaming server, security camera, or file sharing service from anywhere in the world. This guide will walk you through all the setup steps using typical routers and operating systems.

Requirements

Before you begin, make sure you have:

  • Access to the router: The router's IP address (usually 192.168.1.1 or 192.168.0.1), login, and password. Defaults are often admin/admin or listed on a sticker.
  • Local IP address of the target device: The computer or other device to which you want to forward the port.
  • Service information: The port number (e.g., 25565 for Minecraft) and protocol (TCP, UDP, or both). Check your application's documentation.
  • The device must be powered on and connected to the network.
  • Recommended: Reserve a static IP for the target device in the router's DHCP settings to prevent the address from changing after a reboot.

💡 Tip: If you don't know your router's IP, on Windows run ipconfig in the command prompt and look for "Default Gateway." On Linux/macOS, use ip route | grep default or netstat -rn.

Step-by-Step Instructions

Step 1: Determine the Device's Local IP Address

On the device that will receive connections (e.g., a computer running a server), you need to find its current local IP address. This is the address within your home network, such as 192.168.1.100.

For Windows:

  1. Press Win + R, type cmd, and press Enter.
  2. In the command prompt, run:
    ipconfig
    
  3. Find the section for your network adapter (Ethernet or Wi-Fi) and copy the "IPv4 Address" value. For example: 192.168.1.100.

For Linux (Ubuntu, Debian, etc.):

  1. Open the terminal.
  2. Run one of the following commands:
    ifconfig
    
    or
    ip addr show
    
  3. Find the interface (e.g., eth0 or wlan0) and the inet address (not inet6). That is your IP.

For macOS:

  1. Open Terminal from Utilities.
  2. Run:
    ifconfig en0
    
    (for Wi-Fi, en0 might be en1 depending on the model).
  3. Look for inet after en0:.

Write down this address—you will need it in Step 4.

Step 2: Log into the Router's Web Interface

  1. Connect to your home network (via Wi-Fi or cable) from the device you will use for configuration.
  2. Open any browser (Chrome, Firefox, Edge).
  3. In the address bar, enter the router's IP address. Most commonly it is 192.168.1.1 or 192.168.0.1. If that doesn't work, check the sticker on the router or use the gateway found in Step 1.
  4. Press Enter. A login page should appear.
  5. Enter the login and password. Defaults are often:
    • Login: admin
    • Password: admin or password If you changed the password, use your own. If you forgot it, you may need to reset the router to factory settings (press the Reset button on the case for 10 seconds).

After logging in, you will see the router's control panel.

Step 3: Find the Port Forwarding Section

Router interfaces vary by manufacturer and model. The port forwarding section may be named differently:

  • Port Forwarding
  • Virtual Server
  • NAT Forwarding
  • Перенаправление портов (Russian for Port Forwarding)
  • Services
  • SecurityPort Forwarding

It is usually located in menus such as:

  • WAN / Internet
  • Advanced / Дополнительно
  • Security / Безопасность
  • LAN / Local Network

If you cannot find it, search the documentation for your model (e.g., "TP-Link Archer C7 port forwarding") or online.

Step 4: Add a Port Forwarding Rule

  1. In the port forwarding section, click the Add (Добавить), Create (Создать), or + button.
  2. Fill in the form fields. Exact names may differ, but the concept is the same:
    • External Port / WAN Port / Внешний порт: The port that will be open from the internet. For example, 25565 for Minecraft. You can specify a range if multiple ports are needed.
    • Internal Port / LAN Port / Внутренний порт: The port on the target device. Often it matches the external port, but it can differ if the service on the device listens on a different port.
    • Protocol / Протокол: Select TCP, UDP, or Both (both). For accuracy, check your application's documentation. For example, Minecraft uses TCP, while some games use UDP.
    • Internal IP Address / LAN IP / Внутренний IP адрес: Enter the local IP address you determined in Step 1 (e.g., 192.168.1.100).
    • Description / Имя (optional): A brief description, like "Minecraft Server," to avoid confusion with the rule.
  3. Click Save (Сохранить) or Apply (Применить).
  4. The router may prompt you to reboot. Do so if required.

⚠️ Important: Ensure the service (server) is running on the target device and listening on the specified internal port. Otherwise, the forwarding will work, but connections will not be accepted.

If the device's IP address is assigned dynamically (via DHCP), it may change after a router or device reboot, breaking the port forward. To avoid this, reserve the address.

Method A: Reservation in the Router (Preferred)

  1. In the router's web interface, find the DHCP or Local NetworkARP or DHCP Clients section.
  2. Locate your device in the list (by name or MAC address).
  3. Click "Reserve" (Резервировать) or "Add" and bind it to a specific IP (the one you used in the port forward rule).
  4. Save the settings.

Method B: Configure a Static IP on the Device

  • Windows: Control Panel → Network and Internet → Network and Sharing Center → Change adapter settings → Right-click the adapter → Properties → IPv4 → Specify an IP address, subnet mask (usually 255.255.255.0), gateway (router's IP), and DNS (can be the gateway).
  • Linux: Edit the interface configuration file (e.g., /etc/netplan/01-netcfg.yaml for Ubuntu) or use nmcli.
  • macOS: System Preferences → Network → Advanced → TCP/IP → Configure IPv4: Manually.

Ensure the static IP is in the same subnet as the router (e.g., 192.168.1.x) and does not overlap with the DHCP pool to avoid conflicts.

Step 6: Test the Port Forward

  1. Ensure the service (e.g., a game server) is running on the target device.
  2. From a computer or phone connected to a different network (not your home network, e.g., mobile data), try connecting to your external IP address and port.
    • To find your external IP, visit a site like 2ip.ru or similar.
  3. Use online port scanners to check if the port is open:
  4. If the check shows the port is closed, recheck all settings, ensure the firewall on the device is not blocking the port, and verify your ISP is not blocking it (sometimes ISPs block specific ports).

Verification

After successful port forwarding, you should be able to:

  • Connect to the service from any device on the internet using your external IP address and the specified port.
  • For example, for a game server: in the game, add a server with the address your_external_IP:port.
  • For a web server: open http://your_external_IP:port in a browser.

If the connection fails, refer back to the "Troubleshooting" section.

Troubleshooting

The Port Remains Closed After Configuration

  • Cause: The service on the device is not running or is listening on a different port.
    • Solution: Start the server and check which port it uses (e.g., in a configuration file).
  • Cause: Incorrect local IP address in the rule.
    • Solution: Recheck the device's IP. If the IP is dynamic, set up a static IP or reservation.
  • Cause: The firewall on the device is blocking the port.
    • Solution: Add a firewall rule to allow incoming connections on the required port (TCP/UDP). On Windows: Windows Defender Firewall → Advanced Settings → Inbound Rules.
  • Cause: The ISP is blocking the port (especially common ones like 25 for SMTP).
    • Solution: Change to a different, unblocked port or contact your ISP.

Cannot Access the Router's Web Interface

  • Cause: Incorrect router IP.
    • Solution: Check the gateway via ipconfig or ip route.
  • Cause: Incorrect login/password.
    • Solution: Reset the router to factory settings (hold the Reset button for 10 seconds). After resetting, use the default credentials from the sticker.
  • Cause: The router is not responding.
    • Solution: Reboot both the router and your device.

No External Access After Setup, but Local Works

  • Cause: NAT loopback is not supported by the router. Some routers do not allow connecting to their own external IP from inside the network.
    • Solution: Test the connection from an external network (e.g., using mobile data).
  • Cause: Double NAT (if you have multiple routers).
    • Solution: Configure port forwarding on the main router connected to the ISP, and on the secondary router if necessary.

Port Scans Open, but Service Does Not Respond

  • Cause: The service is configured to listen only on localhost (127.0.0.1) or a specific IP, not on all interfaces.
    • Solution: Configure the service to listen on 0.0.0.0 (all interfaces) or on the device's local IP.
  • Cause: Incorrect protocol.
    • Solution: Ensure the correct protocol (TCP/UDP) is selected in the rule. Some services require both.

F.A.Q.

What is port forwarding and what is it used for?
How to find your local IP address?
Why is port forwarding not working?
Do I need to disable the firewall when setting up port forwarding?

Hints

Determine the local IP address of the device
Log into the router's web interface
Find the port forwarding section
Add a port forwarding rule
Set up a static IP for the device
Test the port forwarding
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community