在linux下使用softether client。
服务器端怎么搭建,客户端怎么安装,这里就不说了。这里提供的方案,是一直困扰我的一个问题。我有一台softether server,用windows的图形客户端连接,完全没有问题,dhcp这些设置也都正常。不过linux一直都没能连上。这里说明一下,要怎么做才能来连上。
1、启动softether client。
[code language=”bash”]
$ vpnclient start
[/code]
2、打开时vpncmd,启动client的远程控制。
[code language=”bash”]
$ VPN Client >> RemoteEnable //启动远程管理
[/code]
3、使用windows的图形管理界面,连上服务器
4、连上后,执行下面这行命令就好了
[code language=”bash”]
$ dhclient
[/code]
这行命令会跟服务器的dhcp联系,更新网卡的信息。顺便做一下全局路由。这时候查看softether的网卡,会发现网卡的信息全了,查看本地路由,全局路由都配好了。如果不喜欢全局路由的话,自己修改路由配置就好了。
[code language=”bash”]
[root@localhost vpnclient]# dhclient
[root@localhost vpnclient]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.8.5 netmask 255.255.255.0 broadcast 192.168.8.255
inet6 fe80::20c:29ff:fea9:4f6e prefixlen 64 scopeid 0x20 <link>
ether 00:0c:29:a9:4f:6e txqueuelen 1000 (Ethernet)
RX packets 89368 bytes 27207229 (25.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 39176 bytes 4982013 (4.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 4527 bytes 313069 (305.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4527 bytes 313069 (305.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
//softether nic 信息完整了
vpn_vpn: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.30.10 netmask 255.255.255.0 broadcast 192.168.30.255
inet6 fe80::2ac:13ff:fe8f:a4d6 prefixlen 64 scopeid 0x20 <link>
ether 00:ac:13:8f:a4:d6 txqueuelen 1000 (Ethernet)
RX packets 51 bytes 4048 (3.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 63 bytes 6950 (6.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost vpnclient]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.30.1 0.0.0.0 UG 0 0 0 vpn_vpn //全局路由
112.91.128.50 192.168.8.1 255.255.255.255 UGH 0 0 0 ens33
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 ens33
192.168.8.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33
192.168.30.0 0.0.0.0 255.255.255.0 U 0 0 0 vpn_vpn
[/code]