やりたかったこと
以下のエントリを見て、自分でもやってみたいと思った。
手元の環境から接続できることが目的。
変更点
-
インスタンスのOSはUbuntuに
-
systemdのユニットファイルについては、
https://gihyo.jp/admin/serial/01/ubuntu-recipe/0788
を参考に次のように改変した。vpnserver.service[Unit] Description=SoftEther VPN Server After=network.target auditd.service ConditionPathExists=!/opt/vpnserver/do_not_run [Service] Type=forking EnvironmentFile=-/opt/vpnserver ExecStartPre=/sbin/ip link set dev <NICの名前> promisc on ExecStart=/opt/vpnserver/vpnserver start ExecStop=/opt/vpnserver/vpnserver stop KillMode=process Restart=on-failure # Hardening PrivateTmp=yes ProtectHome=yes ProtectSystem=full ReadOnlyDirectories=/ ReadWriteDirectories=-/opt/vpnserver CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_ADMIN CAP_SETUID [Install] WantedBy=multi-user.target
-
vpncmdで以下のコマンドを打った時の、
DhcpSet /START:192.168.30.10 /END:192.168.30.200 /MASK:255.255.255.0 /EXPIRE:7200 /GW:192.168.30.1 /DNS:192.168.30.1 /DNS2:none /DOMAIN:none /LOG:yes /PUSHROUTE:"10.0.0.0/255.255.0.0/192.168.30.1"
/PUSHROUTE:"10.0.0.0/255.255.240.0/192.168.30.1"
の部分については、IPv4 CIDRから、(プライベート)IPアドレスとサブネットを確認
今回はIPアドレスが172.31.0.0、サブネットが(prefix表記で/16なので)255.255.0.0となるので、以下のようになる。
/PUSHROUTE:"172.31.0.0/255.255.0.0/192.168.30.1"
あとはがんばる
がんばって!💪