[GH-ISSUE #2180] Multiple tunnels per instance #1735

Closed
opened 2026-05-05 13:06:51 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @thesocialproxy on GitHub (Jan 6, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2180

The solution you want
I have reviewed the docs extensively, but I could not find a way to open several tunnels via 1 instance of frp, I would like to add support to make that possible, so frps will look something like that:
[common1]
bind_port = 7000
[common2]
bind_port = 8000

Alternatives considered
I am pretty sure there are some VPNs that support that, or just running multiple instances of frp, but it becomes hard to manage.

How to implement this function
No idea to be honest. Looking for advice on how to implement this.

Application scenarios of this function
I am working on a system where an IoT device will need to have 24/7 internet connectivity, so we are packing it with 5 different 4G network interfaces, all of which don't support port forwarding. This feature will make it possible to access all 5 interfaces independently of one another.

Originally created by @thesocialproxy on GitHub (Jan 6, 2021). Original GitHub issue: https://github.com/fatedier/frp/issues/2180 <!-- From Chinese to English by machine translation, welcome to revise and polish. --> **The solution you want** I have reviewed the docs extensively, but I could not find a way to open several tunnels via 1 instance of frp, I would like to add support to make that possible, so frps will look something like that: [common1] bind_port = 7000 [common2] bind_port = 8000 **Alternatives considered** I am pretty sure there are some VPNs that support that, or just running multiple instances of frp, but it becomes hard to manage. **How to implement this function** No idea to be honest. Looking for advice on how to implement this. **Application scenarios of this function** I am working on a system where an IoT device will need to have 24/7 internet connectivity, so we are packing it with 5 different 4G network interfaces, all of which don't support port forwarding. This feature will make it possible to access all 5 interfaces independently of one another.
gitea-mirror 2026-05-05 13:06:51 -06:00
Author
Owner

@fatedier commented on GitHub (Jan 6, 2021):

You can deploy multiple tunnels like example configures https://github.com/fatedier/frp/blob/dev/conf/frpc_full.ini

# frpc.ini
[common]
xxx

[tcp1]
xxx

[tcp2]
xxx
<!-- gh-comment-id:755305089 --> @fatedier commented on GitHub (Jan 6, 2021): You can deploy multiple tunnels like example configures https://github.com/fatedier/frp/blob/dev/conf/frpc_full.ini ```ini # frpc.ini [common] xxx [tcp1] xxx [tcp2] xxx ```
Author
Owner

@thesocialproxy commented on GitHub (Jan 6, 2021):

Thanks! @fatedier correct me if I am wrong, but in this example all the traffic will still go through the 1 tunnel created between frpc and frps, right?

So for example, if frps looks like this:

[common]
bind_port = 7000

and frpc looks like this:

[common]
server_addr = 1.1.1.1
server_port = 7000

[tcp1]
type = tcp
local_port = 1001
remote_port = 2001

[tcp2]
type = tcp
local_port = 1002
remote_port = 2002

Then there will be 2 local ports (1001,1002) and 2 listening ports on frps (2001,2002), but all the traffic will still get routed from the main interface of frpc, on 1 tunnel on port 7000.

I am looking for a way to create multiple "bind_ports" tunnels, each one for a different interface, is that possible and I am missing somthing?

<!-- gh-comment-id:755403780 --> @thesocialproxy commented on GitHub (Jan 6, 2021): Thanks! @fatedier correct me if I am wrong, but in this example all the traffic will still go through the 1 tunnel created between frpc and frps, right? So for example, if frps looks like this: ``` [common] bind_port = 7000 ``` and frpc looks like this: ``` [common] server_addr = 1.1.1.1 server_port = 7000 [tcp1] type = tcp local_port = 1001 remote_port = 2001 [tcp2] type = tcp local_port = 1002 remote_port = 2002 ``` Then there will be 2 local ports (1001,1002) and 2 listening ports on frps (2001,2002), but all the traffic will still get routed from the main interface of frpc, on 1 tunnel on port 7000. I am looking for a way to create multiple "bind_ports" tunnels, each one for a different interface, is that possible and I am missing somthing?
Author
Owner

@fatedier commented on GitHub (Jan 7, 2021):

Yes, you should deploy 2 frps if you want to bind different net interfaces. You can configure it by bind_addr in frps.ini.

However, i'm not sure why you need to do that. You can bind 0.0.0.0 on all net interfaces and configure it in frpc.ini server_addr to choose which one to use.

<!-- gh-comment-id:755856539 --> @fatedier commented on GitHub (Jan 7, 2021): Yes, you should deploy 2 frps if you want to bind different net interfaces. You can configure it by `bind_addr` in `frps.ini`. However, i'm not sure why you need to do that. You can bind `0.0.0.0` on all net interfaces and configure it in `frpc.ini` `server_addr` to choose which one to use.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 22, 2021):

Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.

<!-- gh-comment-id:782975930 --> @github-actions[bot] commented on GitHub (Feb 22, 2021): Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#1735
No description provided.