Tips Cách Port Forward khi chia vps trên dedicated server chạy Ubuntu

ducsieu782

New member
** #howto #PortForwarding #VPs #DedIdeServer #ubuntu **

## Chuyển tiếp cổng trên một VPS được chia trên máy chủ chuyên dụng chạy Ubuntu

Chuyển tiếp cổng là một kỹ thuật kết nối mạng cho phép bạn truy cập các dịch vụ trên máy chủ từ xa từ máy cục bộ.Điều này có thể hữu ích cho nhiều mục đích khác nhau, chẳng hạn như truy cập máy chủ web hoặc cơ sở dữ liệu từ máy tính gia đình của bạn hoặc lưu trữ máy chủ trò chơi cho bạn bè của bạn.

Để chuyển tiếp trên một VPS được chia trên một máy chủ chuyên dụng chạy Ubuntu, bạn sẽ cần phải:

1. ** Đăng nhập vào VPS của bạn. **
2. ** Mở thiết bị đầu cuối. **
3. ** Cài đặt gói `iptables`. **
4. ** Tạo quy tắc chuyển tiếp cổng mới. **
5. ** Lưu quy tắc và áp dụng nó. **

Dưới đây là các bước chi tiết hơn:

1. Đăng nhập vào VPS của bạn bằng SSH.
2. Mở thiết bị đầu cuối bằng cách nhập `ctrl`+` alt`+`t`.
3. Cài đặt gói `iptables` bằng cách nhập lệnh sau:

`` `
Sudo apt-get cài đặt iptables
`` `

4. Tạo quy tắc chuyển tiếp cổng mới bằng cách nhập lệnh sau:

`` `
sudo iptables -a forward -p tcp -dort <port> -j Chấp nhận
`` `

Thay thế `<port>` bằng số cổng mà bạn muốn chuyển tiếp.Ví dụ: để chuyển tiếp cổng 80, bạn sẽ nhập lệnh sau:

`` `
sudo iptables -a forward -p tcp -dort 80 -j Chấp nhận
`` `

5. Lưu quy tắc và áp dụng nó bằng cách nhập lệnh sau:

`` `
sudo iptables-save && sudo dịch vụ iptables khởi động lại
`` `

Bây giờ, bạn sẽ có thể truy cập dịch vụ trên máy chủ từ xa từ máy cục bộ của bạn.Ví dụ: nếu bạn chuyển tiếp cổng 80, bạn sẽ có thể truy cập máy chủ web trên máy chủ từ xa bằng cách nhập URL sau vào trình duyệt của bạn:

`` `
http: // <your_vps_ip_address>: 80
`` `

## hashtags

* #NetWorking
* #linux
* #máy chủ
* #VPs
* #cổng chuyển tiếp
=======================================
**#HowTo #PortForwarding #VPs #dedicatedserver #ubuntu**

## Port forwarding on a VPS divided on a dedicated server running Ubuntu

Port forwarding is a networking technique that allows you to access services on a remote server from a local machine. This can be useful for a variety of purposes, such as accessing a web server or database from your home computer, or hosting a game server for your friends.

To port forward on a VPS divided on a dedicated server running Ubuntu, you will need to:

1. **Log in to your VPS.**
2. **Open the terminal.**
3. **Install the `iptables` package.**
4. **Create a new port forwarding rule.**
5. **Save the rule and apply it.**

Here are the steps in more detail:

1. Log in to your VPS using SSH.
2. Open the terminal by typing `Ctrl`+`Alt`+`T`.
3. Install the `iptables` package by typing the following command:

```
sudo apt-get install iptables
```

4. Create a new port forwarding rule by typing the following command:

```
sudo iptables -A FORWARD -p tcp --dport <port> -j ACCEPT
```

Replace `<port>` with the port number that you want to forward. For example, to forward port 80, you would type the following command:

```
sudo iptables -A FORWARD -p tcp --dport 80 -j ACCEPT
```

5. Save the rule and apply it by typing the following command:

```
sudo iptables-save && sudo service iptables restart
```

Now, you should be able to access the service on the remote server from your local machine. For example, if you forwarded port 80, you would be able to access the web server on the remote server by typing the following URL in your browser:

```
http://<your_VPS_IP_address>:80
```

## Hashtags

* #NetWorking
* #linux
* #Server
* #VPs
* #PortForwarding
 
Join Telegram ToolsKiemTrieuDoGroup
Back
Top