前準備として、次のポートを利用できるようにします。
- 500/udp
- 4500/udp
- 5555/tcp
- 443/tcp
次のように設定します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # firewall-cmd --permanent --zone=public --add-service=ipsec # firewall-cmd --permanent --zone=public --add-port=5555/tcp # firewall-cmd --permanent --add-rich-rule="rule family=ipv4 source address=192.168.0.0/23 service name=https accept" # firewall-cmd --reload ... # firewall-cmd --list-all public (active) target: default icmp-block-inversion: no interfaces: br0 enp4s0 enp0s31f6 enp5s0 sources: services: ssh dhcpv6-client ipsec ports: 5555/tcp protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules: rule family="ipv4" source address="192.168.0.0/23" service name="https" accept ... |
ただ、CentOS7では、initではなくsystemdを利用するようになっているため、起動用のunitファイルを作成する必要がありました。
公式サイトに記載されているinit用の起動スクリプトを参考に下記のunitファイルを作成しました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # cat /etc/systemd/system/vpnserver.service [Unit] Description=SoftEther VPN Server After=network.target [Service] Type=forking ExecStart=/usr/local/vpnserver/vpnserver start ExecStop=/usr/local/vpnserver/vpnserver stop Restart=on-abort RestartSec=3 [Install] WantedBy=multi-user.target |
1 2 | # systemctl enable vpnserver # systemctl start vpnserver |
0 件のコメント:
コメントを投稿