Hello.
I've configured a proxy server inside an Ubuntu bhyve/vm and I want to connect to it through Firefox using the terminal on FreeBSD,instead of going on the Firefox setting and adding the proxy informations manually or pressing the "enable" button manually. Yes,I like to script everything as much as I can.
I've found a repository that contains a script that helps to setup a SOCKS5 proxy server on an Ubuntu system. The server uses dante-server and supports username/password authentication.
I have virtualized Ubuntu with bhyve and I've followed the instructions explained in the repository :
https://github.com/saaiful/socks5
basically,inside my Ubuntu 23.04 system (that has IP number = 192.168.10 and network interface = enp0s13) I did :
I checked that it worked on FreeBSD (in FreeBSD the IP assigned is 192.168.1.5) :
at this point,on Firefox I have configured the SOCKS5 proxy using the IP assigned to Linux and the port used by the script :
and boom. It worked like I wanted. But there is the last thing that I want to do,I want to automate and speed up the procedure. I would like to connect to the proxy through Firefox in FreeBSD using the terminal,instead of going on the Firefox setting and enabling the proxy there.
Maybe I found how to do that by reading this old thread :
I edited the /usr/local/etc/tsocks.conf file like this :
and finally I tried to launch Firefox with tsocks :
Unfortunately this time my IP isn't changed. So it didn't work.
I've configured a proxy server inside an Ubuntu bhyve/vm and I want to connect to it through Firefox using the terminal on FreeBSD,instead of going on the Firefox setting and adding the proxy informations manually or pressing the "enable" button manually. Yes,I like to script everything as much as I can.
I've found a repository that contains a script that helps to setup a SOCKS5 proxy server on an Ubuntu system. The server uses dante-server and supports username/password authentication.
I have virtualized Ubuntu with bhyve and I've followed the instructions explained in the repository :
https://github.com/saaiful/socks5
basically,inside my Ubuntu 23.04 system (that has IP number = 192.168.10 and network interface = enp0s13) I did :
Code:
# wget https://raw.githubusercontent.com/saaiful/socks5/main/socks5.sh
# sudo bash socks5.sh
# nano /etc/danted.conf
logoutput: /var/log/danted.log
internal: 0.0.0.0 port = 1080
external: enp0s13
method: username none
user.privileged: root
user.notprivileged: nobody
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect disconnect error
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect disconnect error
# systemctl enable danted
# systemctl start danted
I checked that it worked on FreeBSD (in FreeBSD the IP assigned is 192.168.1.5) :
Code:
# curl -x socks5://192.168.1.10:1080 https://ifconfig.me
87.14.68.111 ---> it works. it is the IP assigned to Ubuntu.
at this point,on Firefox I have configured the SOCKS5 proxy using the IP assigned to Linux and the port used by the script :
and boom. It worked like I wanted. But there is the last thing that I want to do,I want to automate and speed up the procedure. I would like to connect to the proxy through Firefox in FreeBSD using the terminal,instead of going on the Firefox setting and enabling the proxy there.
Maybe I found how to do that by reading this old thread :
How to configure an entire OS to SOCKS5?
I have a new FreeBSD 13 PC behind a firewall and need to connect to a SOCKS5 proxy to "go out". How do I configure the operating system to proxy to a fixed SOCKS IP address and fixed port?* * So all applications will just "go out" without configuring each one individually.
forums.freebsd.org
I edited the /usr/local/etc/tsocks.conf file like this :
Code:
# Local networks
# For this example this machine can directly access 192.168.1.0/255.255.255.0
# (192.168.1.*) and 10.0.0.0/255.0.0.0 (10.*)
local = 192.168.1.0/255.255.255.0
local = 10.0.0.0/255.0.0.0
# Default server
# For connections that aren't to the local subnets or to 150.0.0.0/255.255.0.0
# the server at 192.168.0.1 should be used (again, hostnames could be used
# too, see note above)
server = 192.168.1.10
# Server type defaults to 4 so we need to specify it as 5 for this one
server_type = 5
# The port defaults to 1080 but I've stated it here for clarity
server_port = 1080
and finally I tried to launch Firefox with tsocks :
Code:
tsocks firefox
Unfortunately this time my IP isn't changed. So it didn't work.