frp icon indicating copy to clipboard operation
frp copied to clipboard

[Feature Request] Specify source interface for the client

Open alimdi opened this issue 1 year ago • 10 comments

Describe the feature request

Hi,

Is it possible to specify the source interface to use on the client side ?

Regards,

Describe alternatives you've considered

No response

Affected area

  • [ ] Docs
  • [ ] Installation
  • [ ] Performance and Scalability
  • [ ] Security
  • [ ] User Experience
  • [ ] Test and Release
  • [ ] Developer Infrastructure
  • [ ] Client Plugin
  • [ ] Server Plugin
  • [ ] Extensions
  • [X] Others

alimdi avatar Mar 28 '23 16:03 alimdi

Can you describe more detail ? How to specify and why ?

blizard863 avatar Mar 29 '23 13:03 blizard863

Hi,

Can you describe more detail ? How to specify and why ?

Sure, I meant is it possible to make the client use a specific network interface when connecting to the server in case of having multiple network interfaces. Hope that makes the request more clear

alimdi avatar Mar 30 '23 08:03 alimdi

I got it. @alimdi

I think the connect_server_local_ip arg will match your demand ?

https://github.com/fatedier/frp/blob/dev/conf/frpc_full.ini#L104

blizard863 avatar Mar 30 '23 11:03 blizard863

That's definetly what I was looking for. Thank you @blizard863

alimdi avatar Mar 30 '23 11:03 alimdi

@alimdi is this worked for you? i am looking for the same with http_proxy plugin and using the below config [http_proxy] type = tcp connect_server_local_ip = 192.168.10.100 remote_port = 24002 plugin = http_proxy plugin_http_user = plugin_http_passwd =

but it still providing my default network

mecorpking avatar May 02 '23 19:05 mecorpking

@mecorpking It is working but I've defined connect_server_local_ip in [common] scope not in [http_proxy] Give it a shot...

alimdi avatar May 03 '23 16:05 alimdi

@alimdi i tried with that also but received " login to server failed: i/o deadline reached". if possible can you share sample frps.ini and frpc.ini , below is my sample file

server_addr = 1.2.3.4 /sample server_port = 2000 token = 12345678 log_file = ./connection.log protocol = tcp connect_server_local_ip = 192.168.10.100 tcp_mux = true

[http_proxy] type = tcp remote_port = 24003 plugin = http_proxy plugin_http_user = plugin_http_passwd =

mecorpking avatar May 03 '23 16:05 mecorpking

I'm not using http_proxy Have you tried to check if the interface were used with tcpdump ?

alimdi avatar May 03 '23 16:05 alimdi

i think there is some issue with my frps config if you could share, it will help alot

mecorpking avatar May 03 '23 16:05 mecorpking

frpc :

[common]
server_addr = 100.100.100.100
server_port = 7000
log_file = /var/log/frpc.log
log_level = info
log_max_days = 3
disable_log_color = false
authenticate_heartbeats = true
authenticate_new_work_conns = true
token = 123456
authentication_method = token
admin_addr = 127.0.0.1
admin_port = 7400
admin_user = admin
admin_pwd = secure-password
pool_count = 5
login_fail_exit = true
protocol = tcp
connect_server_local_ip = 192.168.1.1
tls_enable = false
udp_packet_size = 1500
disable_custom_tls_first_byte = false
pprof_enable = false
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 2222

frps :

[common]
bind_addr = 100.100.100.100
bind_port = 7000
bind_udp_port = 7001
kcp_bind_port = 7000
dashboard_addr = 100.100.100.100
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = secure-password
dashboard_tls_mode = false
enable_prometheus = true
log_file = /var/log/frps.log
log_level = info
log_max_days = 3
disable_log_color = false
detailed_errors_to_client = true
authentication_method = token
authenticate_heartbeats = true
authenticate_new_work_conns = true
token = 123456
oidc_issuer =
oidc_audience =
oidc_skip_expiry_check = false
oidc_skip_issuer_check = false
allow_ports = 2222
max_pool_count = 5
max_ports_per_client = 0
tls_only = false
udp_packet_size = 1500
pprof_enable = false

alimdi avatar May 03 '23 16:05 alimdi