How to share VPN internet with OpenWrt

I want to share an Internet which is connected to my VPN with OpenWrt.

I run this command on openwrt's ssh:

ssh -L 1010:localhost:1010 root@my_server -pPort

I cannot run ssh -D 1010 root@my_server -pPort, because it shows this output:

Dropbear v2022.82

Is that possible to change the wireless connection for my clients so that when they connect to my router, their internet IP is my_server's IP?

Could try to install openssh-server.

1 Like

I did that before, but still no luck.

root@OpenWrt:~# opkg upgrade openssh-server; opkg install openssh-server
Package openssh-server (8.9p1-1) installed in root is up to date.

Is the openwrt device the source, or destination for the connection?

1 Like

I don't know what you mean, but this is my topology:

I connect to my router via WiFi,
I ssh into,
I run ssh -L ... command (because -D does not work,
I reconnect to my WiFi.

I hope I could answer you.

Where, on the openwrt device?

Yes, I run it into the router, the openwrt device

Into <> on, which one is it?

What do you mean?

I may be wrong at all.
Do you please help me how can I share internet with VPN?
Now when I search my ip, it shows my dynamic IP for the internet.
But I want to show my public IP of my_server.

Ssh is creating tunnels not VPNs, if you want proper VPN, set up wireguard.

Does you server have a public IP?

But I think you need openssh-client on your router, but it's only a guess, since you're not answering the questions...

Ssh, is creating tunnels not VPNs

Yes, but I create socks using ssh and do my stuffs in my laptop.
I want to run that in my router and openwrt, so there would be no need to run ssh command for each device separately..

Does you server have a public IP?


since you're not answering the questions

Sorry, I did not get you mean completely. Could you please rephrase them?

But I think you need openssh-client on your router, but it's only a guess

I installed this now and it's working with ssh -D, but my problem is not solved unfortunately.

Still don't know what the problem is exactly, so your guess is as good as mine...

But I would guess -D only binds to localhost, by default?

OK, this is what I do in my laptop to have SSH Tunnels to use socks proxy in my laptop:

I run ssh -D1111 root@my_server -pPort and then use localhost as hostname in Firefox, and Port 1111 for it. So when I search my ip in google in Firefox, it shows my server's public IP.
There are around 10 PCs which should separately do this to have my_server's IP to access some websites.

Now I want to run a VPN on my router, so that all those 10 PCs only connect to router with no further configurations in the OS.

Now I want to do the

It's configurable.

ssh -D root@server -pPort
You can change to other IPs for listening.

That's why my post said by default...

How is this

related to


I mean I want my router has a socks proxy as it can be done with SSH Tunneling,.

Then read the thread @lleachii linked to.

1 Like

I read that and I did it.
But still when I connect to my router, my_server's IP is not shown to me.