機器 | GlobalIP | PrivateIP |
Router-1 | 43.244.x.34/32( PPPoE ) | 192.168.1.254/24( fxp1 ) |
Router-2 | 43.244.x.139/32( PPPoE ) | 192.168.2.254/24( fxp1 ) |
cd /usr/src/sys/i386/conf 又は cd /sys/i386/conf cp GENERIC VPN |
options IPSEC options IPSEC_ESP options IPSEC_DEBUG |
make depend make all make install |
##### IPSec Config file ##### flush; spdflush; ##### SAD Entry ##### # 192.168.1.0/24 <-> 192.168.2.0/24 add 43.244.x.34 43.244.x.139 esp 9991 -E simple "foobar"; add 43.244.x.139 43.244.x.34 esp 9992 -E simple "foobar"; ##### SPD Entry ##### # 192.168.1.0/24 <-> 192.168.2.0/24 spdadd 192.168.1.0/24 192.168.2.0/24 any -P out ipsec esp/tunnel/43.244.x.34-43.244.x.139/require; spdadd 192.168.2.0/24 192.168.1.0/24 any -P in ipsec esp/tunnel/43.244.x.139-43.244.x.34/require; |
##### IPSec Config file ##### flush; spdflush; ##### SAD Entry ##### # 192.168.1.0/24 <-> 192.168.2.0/24 add 43.244.x.34 43.244.x.139 esp 9991 -E simple "foobar"; add 43.244.x.139 43.244.x.34 esp 9992 -E simple "foobar"; ##### SPD Entry ##### # 192.168.1.0/24 <-> 192.168.2.0/24 spdadd 192.168.2.0/24 192.168.1.0/24 any -P out ipsec esp/tunnel/43.244.x.139-43.244.x.34/require; spdadd 192.168.1.0/24 192.168.2.0/24 any -P in ipsec esp/tunnel/43.244.x.34-43.244.x.139/require; |
% setkey -D 43.244.x.139 43.244.x.34 esp mode=any spi=9992(0x00002708) reqid=0(0x00000000) E: null 686f6765 6765 seq=0x00000012 replay=0 flags=0x00000040 state=mature created: Oct 1 01:46:01 2003 current: Oct 1 18:25:09 2003 diff: 59948(s) hard: 0(s) soft: 0(s) last: Oct 1 17:30:24 2003 hard: 0(s) soft: 0(s) current: 2040(bytes) hard: 0(bytes) soft: 0(bytes) allocated: 18 hard: 0 soft: 0 sadb_seq=1 pid=36323 refcnt=2 43.244.x.34 43.244.x.139 esp mode=any spi=9991(0x00002707) reqid=0(0x00000000) E: null 686f6765 6765 seq=0x00000000 replay=0 flags=0x00000040 state=mature created: Oct 1 01:46:01 2003 current: Oct 1 18:25:09 2003 diff: 59948(s) hard: 0(s) soft: 0(s) last: Oct 1 11:09:55 2003 hard: 0(s) soft: 0(s) current: 876(bytes) hard: 0(bytes) soft: 0(bytes) allocated: 11 hard: 0 soft: 0 sadb_seq=0 pid=36323 refcnt=1 % setkey -DP 192.168.1.0/24[any] 192.168.2.0/24[any] any in ipsec esp/tunnel/43.244.x.34-43.244.x.139/require spid=5 seq=1 pid=36334 refcnt=1 192.168.2.0/24[any] 192.168.1.0/24[any] any out ipsec esp/tunnel/43.244.x.139-43.244.x.34/require spid=4 seq=0 pid=36334 refcnt=1 |
% ifconfig gif0 create tunnel 43.244.x.34 43.244.x.139 % ifconfig gif0 192.168.1.254 192.168.2.254 netmask 255.255.255.255 % route add 192.168.2.0/24 192.168.2.254 |
% ifconfig gif0 create tunnel 43.244.x.139 43.244.x.34 % ifconfig gif0 192.168.2.254 192.168.1.254 netmask 255.255.255.255 % route add 192.168.1.0/24 192.168.1.254 |
ipsec_enable="YES" gif_interfaces="gif0" gifconfig_gif0="43.244.x.34 43.244.x.139" ifconfig_gif0="192.168.1.254 192.168.2.254 netmask 255.255.255.255" static_routes="vpn1" route_vpn1="192.168.2.0/24 192.168.2.254" |
ipsec_enable="YES" gif_interfaces="gif0" gifconfig_gif0="43.244.x.139 43.244.x.34" ifconfig_gif0="192.168.2.254 192.168.1.254 netmask 255.255.255.255" static_routes="vpn1" route_vpn1="192.168.1.0/24 192.168.1.254" |
ipsec_file="/usr/local/etc/ipsec.conf" |