https://maytalkhao.com/archives/826
以下步驟都是按照上面這篇文章來的,具體細節如下
一、使用Softether VPN Server Manager軟件添加本地網橋
本地網橋設置--選擇要橋接的虛擬hub--要創建的類型--新tap設備名稱--創建本地橋
二、輸入命令:ifconfig tap_soft,如果可以看到tap_soft網卡信息,那么可以進行下一步,否則看看上面步驟是不是哪里出錯了
三、安裝dnsmasq服務
1、yum list |grep dnsmasq 先查詢下包名,我這里得出以下2個軟件包
2、知道包名后就可以安裝了,yum -y install dnsmasq.x86_64 dnsmasq-utils.x86_64
3、安裝完成后配置/etc/dnsmasq.conf,在其中加入以下內容,內容自己看着寫
******切記dhcp-range=tap_soft,192.168.8.2,192.168.8.254,12h 這里的IP范圍給大一些,親自踩過坑
interface=tap_soft
dhcp-range=tap_soft,192.168.8.2,192.168.8.254,12h
dhcp-option=tap_soft,3,192.168.8.1
dhcp-option=option:dns-server,192.168.8.1
resolv-file=/etc/resolv.dnsmasq.conf
strict-order
listen-address=0.0.0.0,::
4、編輯/etc/resolv.dnsmasq.conf(如果沒有則創建),其中加入(nameserver自己看着寫就OK):
vi /etc/resolv.dnsmasq.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 223.5.5.5
nameserver 223.6.6.6
nameserver 114.114.114.114
四、配置softether服務
編輯/etc/init.d/vpnserver文件,如果沒有則創建
#!/bin/sh
-A POSTROUTING -s 192.168.8.0/24 -j SNAT --to-source 123.209.51.80
123.209.51.80就是你服務器的公網IP
-A POSTROUTING -s 192.168.8.0/24 -o eth1 -j MASQUERADE