SoftEther VPN 搭建

SoftEther VPN 搭建




SoftEther VPN 搭建


linux服务器端

    # yum install gcc zlib-devel openssl-devel readline-devel ncurses-devel
    # wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/releases/download/v4.29-9680-rtm/softether-vpnserver-v4.29-9680-rtm-2019.02.28-linux-x64-64bit.tar.gz
    # tar zxvf softether-vpnserver-v4.29-9680-rtm-2019.02.28-linux-x64-64bit.tar.gz -C /usr/local/
    # cd /usr/local/vpnserver
    # make
        1                \\ 同意一些声明
        1
        1

    # vim /etc/systemd/system/vpnserver.service              \\ 创建 启动项
        [Unit] 
        Description=SoftEther Server 
        After=network.target 
        [Service] 
        Type=forking 
        ExecStart=/usr/local/vpnserver/vpnserver start 
        ExecStop= /usr/local/vpnserver/vpnserver stop

        [Install] 
        WantedBy=multi-user.target
        
    # iptables -I INPUT 4 -m state --state NEW -p tcp --dport 5555 -j ACCEPT   \\ 只放行了5555
    # cat /etc/resolv.conf               \\ 记录dns 后面 配置服务端会用到
    # systemctl start vpnserver           \\ 其他防火墙端口 自行尝试 这里可能以前开通过 可能还需要转发
    # systemctl stop vpnserver
    # systemctl enable vpnserver
    # systemctl list-unit-files | grep vpnserver
    # ./vpncmd        \\ 设置管理服务器ip及密码
        1              \\ 此为服务器选项
        47.91.219.64    \\ 输入 服务器ip 即可  端口号默认为8888 不必更改
        ............     \\ Specify Virtual Hub Name  不需要设置 直接回车
        ............      \\ 在windows服务器管理端设置空密码进入即可设置


windows 安装服务器管理端      \\ 仅 管理linux服务器配置

    新设置
        设置名 47.91.219.64
        主机名 47.91.219.64     \\ 填写ip即可  也可以写www.ssyy99.com
        端口号 5555              \\ 端口选择 5555  8888  992 都可以
        密码   ---                \\ 第一次进入此密码 空 即可  之后 设置服务器端密码123456即可

    连接

        IPsec /L2TP /EtherIP/L2tpv3设置  简单安装   \\ 第一次 设置会弹出此对话框  以后在进入则没有
            vpn 的其他高级选项 --> 关闭按钮
            SoftEther VPN Server 管理器 --> 确定      \\ 第一次 设置会弹出此对话框 以后在进入则没有
            IPsec /L2TP /EtherIP/L2tpv3设置           \\ 此选择后期 可更改 在 IPsec/L2TP设置里 更改
                启用 L2TP 服务器功能(L2TP over IPsec)   \\ 前面 打 √
                IPsec 预共享密码 12345678                \\ 此密码为 连接l2tp/IPsec 的共享秘钥     

        SoftEther VPN Server管理器
            管理虚拟 HUB(A)
                管理用户 --> 新建 
                    用 户 名: teo          \\ vpn的用户名
                    验证类型: 密码验证
                    密码设置: 123456         \\ vpn的密码

                虚拟 NAT 和 虚拟 DHCP 服务器(V) 
                    启用 SecureNAT(E) --> 确定
                    SecureNAT 配置 --> DNS服务器地址1 100.100.2.136  \\ 查看此地址在linux服务器端

windows 客户端
    1 可以使用 vpn 创建l2tp/ipsec 进行连接 用户名teo 密码123456 秘钥12345678
    2 可以使用 SoftEther VPN Client 客户端进行连接
        安装
        添加新的VPN连接
            连接设置名: aaaaaa
            主机名:     47.91.219.64
            端口号:     5555
            HUB名:      DEFAULT
            用户名:     teo
            密码:       123456


注: 
    下载网址 https://www.softether-download.com/cn.aspx?product=softether
    SOFTETHER VPN SERVER --> windows 



lindux 客户端 搭建

    # wget https://www.softether-download.com/files/softether/v4.34-9745-rtm-2020.04.05-tree/Linux/SoftEther_VPN_Client/64bit_-_Intel_x64_or_AMD64/softether-vpnclient-v4.34-9745-rtm-2020.04.05-linux-x64-64bit.tar.gz
    # tar zxvf softether-vpnclient-v4.34-9745-rtm-2020.04.05-linux-x64-64bit.tar.gz -C /usr/local/
    # cd /usr/local/vpnserver/
    # make
    # vim /etc/systemd/system/vpnclient.service
        [Unit]
        Description=SoftEther Server
        After=network.target
        [Service]
        Type=forking
        ExecStart=/usr/local/vpnserver/vpnclient start
        ExecStop= /usr/local/vpnserver/vpnclient stop
        [Install]
        WantedBy=multi-user.target
        
    # /usr/local/vpnclient/vpnclient start  \\ 可以用此启动
    # systemctl start vpnclient              \\ 添加到 管理
    # ss -tnl                     \\ 9930端口被监听 好像也没啥用
    # cd /usr/local/vpnclient
    # vim lang.config               \\ 修改语言 为中文
        cn
    # ./vpncmd                        \\ 
        2 --> 直接回车

    VPN Client> help                   \\ 查看命令帮助
    VPN Client> AccountCreate           \\ 创建新的 连接
        连接设置名: admin                                 \\ 此名 为 随便设置的
        终端 VPN Server 主机名和端口号: 47.91.219.64:443    \\ 此为vpn服务器的ip及端口号
        终端虚拟 HUB 名称: DEFAULT                           \\ 服务器端创建的 默认为 DEFAULT
        连接用户名: admin                                     \\ * 此为 vpn的用户名
        使用虚拟 LAN 卡名称: admin                             \\ 没啥用 填admin即可
    VPN Client> AccountProxyNone            \\ 设置为tcp/ip直连方式
        连接设置名: admin                     \\ 设置 admin 的连接方式
    VPN Client> AccountPasswordSet             \\ 设置连接的 密码
        连接设置名: admin                        \\ 设置 admin 的
        密码    : 123456                         \\ *此为 vpn的 密码
        确认输入: 123456
        指定 standard 或者 radius: standard        \\ 填standard就好
    VPN Client> AccountList                        \\ 查看 连接列表 及状态
    VPN Client> AccountConnect                      \\ 连接vpn
    VPN Client> AccountList
        状态                   |已连接                 \\ 已连接即为成功、

    VPN Client> AccountDetailSet                       \\ 可设置高级选项 在这里没有设置
    VPN Client> AccountDelete             \\ 删除连接设置
    VPN Client> AccountDisconnect          \\ 断开连接中的连接设置

    注:
        1. 如果没有获取到ip地址 可以执行以下操作

            # ifconfig         \\ 会多网卡 vpn_vpn 会发现未获取到ip地址
                vpn_vpn:
            # route -n
            # ip route add 47.91.219.64/32 via 192.168.10.1 dev ens192   \\ 添加到vpn服务器的路由 走原来的网关
            # echo "ip route add 47.91.219.64/32 via 192.168.10.1 dev ens192" >> /etc/rc.local \\ 写进开机启动
            # dhclient vpn_vpn      \\ 获取ip地址
            # route -n               \\ 会发现自动添加了路由
            # curl ifconfig.me        \\ 查看外网ip 是否改变

            其他可能会用的命令

                # dhclient -r               \\ 释放ip地址
                # ip route del 18.163.188.1/32 via 115.146.177.1 dev ens224  \\ 删除路由

        2. 开启核心转发可以 充当中转服务器 会把所有收到的报文按照路由表转发出去
            # vim /etc/sysctl.conf
                net.ipv4.ip_forward = 1
            # sysctl -p



使用 VPN 桥接  内网与外网服务器          \\ 可以使外网服务器访问内网的ip  相当于内网穿透

    外网服务器搭建 vpnserver端             \\ 配置vpnserver 参照上面的 配置流程即可

        管理虚拟 HUB --> 管理用户 --> 新建   \\ 创建用户名 密码  用于 内网的连接 
            用户名: teo01
            全名: teo01
            密码: 123456
            确认密码: 123456

        动态DNS
            分配的动态 DNS 主机名
                vpn404782520.softether.net  \\ 这个名字要记住 添加到服务器端 用于连接 亦可以自定义修改

        连接到管理端 --> 本地网桥设置
            虚拟 HUB: DEFAULT                 \\ 默认为default 如修改了填写真实的
            要创建的类型: 新 tap 设备的桥接
            新 tap 设备名称: mi                  \\ 名字随便起
            创建本地桥
        # ip a                                    \\ 会有名字为 tap_mi 的虚拟网卡 但是没有ip 需要配置临时ip  只能配置临时ip
            tap_mi: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
        # ip addr add 172.21.130.209/24 dev tap_mi  \\ 配置 ip  与下面 ip 在一个网段且不冲突即可
        # ip a



    内网服务器搭建 vpnserver端         \\ 两台服务器都搭建 vpnserver端 连接服务器管理配置设置即可

        管理虚拟 HUB --> 管理级联连接 --> 新建
            连接设置名: vpn404782520.softether.net      \\ 名字而已
            主机名: vpn404782520.softether.net           \\ 填写 外网的动态DNS主机名
            端口号: 443                                   \\ 任意一个 监听的端口号
            虚拟HUB名: DEFAULT                             \\ 默认为default 如修改了填写真实的
            用户名: teo01                                   \\ 此为外网vpnserver端的用户名
            密码: 123456                                     \\ 此为外网vpnserver端的密码

        连接到管理端 --> 本地网桥设置
            虚拟 HUB: DEFAULT                 \\ 默认为default 如修改了填写真实的
            要创建的类型: 新 tap 设备的桥接
            新 tap 设备名称: mi                  \\ 名字随便起
            创建本地桥
        # ip a                                    \\ 会有名字为 tap_mi 的虚拟网卡 但是没有ip 需要配置临时ip  只能配置临时ip
            tap_mi: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
        # ip addr add 172.21.130.210/24 dev tap_mi  \\ 配置 ip
        # ip a
        # ping 172.21.130.209                         \\ ping 通即可


修改 VPN Server 语言
    # vim /usr/local/vpnserver/bin/vpncmd/lang.config
        cn
    # vim /usr/local/vpnserver/bin/vpnserver/lang.config
        cn


修改 VPN Server 管理员密码                         \\ 修改 windows端 管理 linux端 vpnserver 的密码

    # /usr/local/vpnserver/bin/vpncmd/vpncmd        \\ vpnserver 命令
        VPN Server>help                              \\ 帮助
        VPN Server>ServerPasswordSet                  \\ 修改密码











Teo

38条评论

movies 发布于00:32 - 2021年2月1日

As I website owner I believe the subject material here is rattling excellent, thanks for your efforts. Martynne Gran Ambrosine

filmkovasi 发布于19:26 - 2021年1月31日

I appreciate you sharing this article post. Really Great. Katie Ram Flanagan

recep ivedik 发布于02:35 - 2021年1月30日

It as going to be finish of mine day, however before ending I am reading this wonderful article to improve my know-how. Dyann Lawry Kahlil

faketaxi 发布于23:17 - 2021年1月21日

Fastidious answers in return of this query with real arguments and telling everything concerning that. Charyl Maurice Geiss

full hd tek parça izle 发布于03:10 - 2021年1月19日

Right away I am going away to do my breakfast, once having my breakfast coming over again to read additional news. Cordelie Reagen Analiese

filmi izle 发布于09:10 - 2021年1月18日

When it comes to gaming, Horror games? Resident Evil. Linzy Timotheus Hannie

filmi izle 发布于05:15 - 2021年1月18日

In this article we will cover Tekken, Mortal Kombat, MMA. Brooks Wyndham Che

izle 发布于09:20 - 2021年1月17日

Way cool! Some extremely valid points! I appreciate you penning this post and the rest of the site is also very good. Jeanie Marmaduke Bamby

film izle 发布于11:05 - 2021年1月14日

Major thanks for the article post. Really thank you! Great. Alexia Felipe Beka

hd film izle 发布于00:32 - 2021年1月14日

Hi to every one, the contents existing at this website are actually awesome for people knowledge, well, keep up the nice work fellows. Iolande Derron Groot

torrent 发布于07:25 - 2021年1月13日

Ja. Den Link kannst Du im Web Player im Share Tab erzeugen. Laurella Myron Posner

altyazili 发布于02:38 - 2021年1月13日

I enjoy your work, thanks for sharing all the useful blogs. Gerda Basilio Marijo

erotik 发布于04:49 - 2020年12月10日

When some one searches for his vital thing, so he/she needs to be available that in detail, thus that thing is maintained over here. Magdalena Darnell Ernst

sikis izle 发布于01:36 - 2020年12月10日

Thanks a lot for the blog article. Really thank you! Awesome. Juline Frasco Belayneh

erotik film izle 发布于22:10 - 2020年12月9日

I have read so many articles concerning the blogger lovers except this article is actually a fastidious article, keep it up. Winnie Arvie Johansen

sikis izle 发布于19:08 - 2020年12月9日

I believe you have mentioned some very interesting details , regards for the post. Addie Wendel Profant

erotik film izle 发布于16:41 - 2020年12月9日

You are likely to sing with nightingale in conservation areas and dance with peacock in national parks. Arielle Greggory Osber

erotik 发布于10:22 - 2020年12月9日

I have read so many articles about the blogger lovers however this article is truly a fastidious post, keep it up. Joby Barclay Cahilly

erotik 发布于15:21 - 2020年12月8日

But wanna tell that this is very beneficial , Thanks for taking your time to write this. Bonita Christos Cunningham

Teo 发布于10:54 - 2020年11月26日

welcome

film 发布于10:35 - 2020年11月24日

I really like it when individuals come together and share thoughts. Meagan Cart Gerdy

film 发布于18:49 - 2020年11月23日

Right now it sounds like Movable Type is the top blogging platform available right now. Arlie Alvan Patrich

film 发布于05:42 - 2020年11月23日

Sorry for making you review this message which is most likely to be thought about by you as spam. Yes, spamming is a bad thing. Myrtia Giff Florri

film 发布于18:32 - 2020年11月21日

You completed some fine points there. I did a search on the matter and found most people will have the same opinion with your blog. Carma Hewitt Guillemette

film 发布于03:57 - 2020年11月20日

Well I definitely liked reading it. This article provided by you is very helpful for correct planning. Dode Bond Bonnee

erotik 发布于16:55 - 2020年11月18日

I beloved up to you will receive performed proper here. Frannie Ax Jauch

sikis izle 发布于16:59 - 2020年11月16日

What a stuff of un-ambiguity and preserveness of valuable experience about unpredicted emotions. Ivie Artemis Essam

sikis izle 发布于06:44 - 2020年11月16日

Having read this I believed it was very informative. I appreciate you taking the time and energy to put this content together. Nicol Osgood Fang

erotik izle 发布于02:38 - 2020年11月16日

Hello mates, good piece of writing and good urging commented here, I am really enjoying by these. Emelina Rory Phaidra

erotik izle 发布于22:51 - 2020年11月15日

Good post! We will be linking to this great content on our site. Keep up the great writing. Cleopatra Claudio Favian

sikis izle 发布于07:41 - 2020年11月15日

Im obliged for the blog post. Much thanks again. Awesome. Blanch Edgardo Franciska

erotik izle 发布于05:18 - 2020年11月15日

Hello Dear, are you in fact visiting this site regularly, if so after that you will without doubt obtain fastidious experience. Cairistiona Garek Vandyke

sikis izle 发布于23:59 - 2020年11月14日

Hi i am kavin, its my first time to commenting anywhere, when i read this article i thought i could also make comment due to this sensible paragraph. Carlee Ash Varhol

erotik 发布于08:07 - 2020年11月14日

Your posts provide a clear, concise description of the issues. Sibilla Rodrigo Zucker

sikis izle 发布于02:10 - 2020年11月14日

You made some clear points there. I did a search on the issue and found most persons will go along with with your blog. Annaliese Prince Ilse

erotik izle 发布于09:57 - 2020年11月13日

I am not real wonderful with English but I line up this real easygoing to interpret. Cornie Nico Ellen

erotik izle 发布于01:52 - 2020年11月13日

If you want to use the photo it would also be good to check with the artist beforehand in case it is subject to copyright. Best wishes. Aaren Reggis Sela

sikis izle 发布于20:47 - 2020年11月12日

If you want to use the photo it would also be good to check with the artist beforehand in case it is subject to copyright. Best wishes. Aaren Reggis Sela

You must be logged in to post a comment