Raspberry Pi の設定
pi2 (余り物)
OS = bullseye
WAN = L-03F (wvdial 設定済)
DDNS = MyDNS.jp (取得済)
● strongSwan
# apt install strongswan # apt install strongswan-swanctl
● swanctl conf
任意名.conf を作成
connections { gw-gw { version = 1 mobike = no local_addrs = [Pi側 DDNS FQDN] remote_addrs = [RTX側 netvolante DNS FQDN] proposals = aes128-sha256-sha1-modp2048,default local { auth = psk id = [Pi ローカルIP] } remote { id = [RTX ローカルIP] auth = psk } children { net-net { esp_proposals = aes128-sha256-sha1-modp2048,default local_ts = [Pi 側 ローカルネットワーク/**] remote_ts = [RTX 側 ローカルネットワーク/**] mode = tunnel start_action = start close_action = start dpd_action = start } } } } secrets { ike-1 { id = [Pi ローカルIP] secret = "[認証鍵]" } }
[ ] = 不要
※ RTX1200 WebGUI 設定では sha1 しか対応してないので
proposals に -sha1- を記入しないと接続出来ない。
● 起動時に swanctl を読み込む
charon { ... 省略 ... start-scripts { swanctl = /usr/sbin/swanctl -q } ... 省略 ... }
● forwarding
#net.ipv4.ip_forward=1 ↓ net.ipv4.ip_forward=1
● 起動・停止
# systemctl start strongswan-starter.service
# systemctl stop strongswan-starter.service
# systemctl enable strongswan-starter.service
● 接続確認
# swanctl -l
これで、[RTX1200] – [raspi] は接続出来たが
pi 側で、iptables を設定しないと raspi 配下の
ネットワークには到達出来ない。