Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use sshuttle to build Virtual Private Network

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to use sshuttle to build a virtual private network, which has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article.

Install sshuttle

Sshuttle is packaged in the official warehouse, so it is easy to install. Open a terminal and use sudo to run the following command:

$sudo dnf install sshuttle

After installation, you can find the relevant information in the man page:

$man sshuttle set up virtual private network

The simplest case is to forward all traffic to the remote network. It's not necessarily a crazy idea, especially if you're not in a trusted local network like your own home. Use the-r option with the SSH username and remote hostname:

$sshuttle-r username@remotehost 0.0.0.0Univer 0

However, you may want to limit the virtual private network to specific subnets, not all network traffic. The full discussion of subnets is beyond the scope of this article, but you can read more on Wikipedia. Suppose you use the reserved Class A subnet 10.0.0.0 and the reserved Class B subnet 172.16.0.0 inside your office. The above command becomes:

$sshuttle-r username@remotehost 10.0.0.0Compare 8 172.16.0.0Universe 16

This is ideal for hosts accessing remote networks through IP addresses. But what if your office is a large network with a large number of hosts? The name may be more convenient or even necessary. Don't worry, sshuttle can also forward DNS queries with the-dns option:

$sshuttle-- dns-r username@remotehost 10.0.0.0Universe 8 172.16.0.0Universe 16

To make sshuttle run as a daemon, add the-D option. It is sent to the systemd log in a syslog-compatible log format.

According to the functions of local and remote systems, sshuttle can be used for IPv6-based virtual private networks. If necessary, you can also set up the configuration file and integrate it with the system startup.

Thank you for reading this article carefully. I hope the article "how to use sshuttle to build a virtual private network" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report