$ cd openvpn-2.2.0/sample-config-files
$ vi server.conf
編集する行と修正内容は、
032: port 1194
036: proto udp
053: dev tun
078: ca /etc/openvpn/keys/ca.crt
079: cert /etc/openvpn/keys/server.crt
080: key /etc/openvpn/keys/server.key # This file should be kept secret
087: dh /etc/openvpn/keys/dh1024.pem
096: server 10.8.0.0 255.255.255.0
262: user nobody
263: group nobody
284: log /var/log/openvpn.log
こんな感じ。できたファイルを、先ほどの keysファイルと同じ場所に置いておきます。
$ sudo cp server.conf /etc/openvpn
MacOS X の FireWall設定
MacOS X のファイアウォールの設定で、OpenVPNが使用するポート番号を開けます。
$ sudo /usr/local/sbin/openvpn /etc/openvpn/server.conf
Sun Jun 19 18:35:23 2011 OpenVPN 2.2.0 powerpc-apple-darwin8.11.0 [SSL] [LZO2] [eurephia]
built on Jun 14 2011
Sun Jun 19 18:35:23 2011 MANAGEMENT: TCP Socket listening on 127.0.0.1:7505
Sun Jun 19 18:35:23 2011 NOTE: your local LAN uses the extremely common subnet address
192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to
the VPN server from public locations such as internet cafes that use the same subnet.
Sun Jun 19 18:35:23 2011 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call
user-defined scripts or executables
Sun Jun 19 18:35:26 2011 Diffie-Hellman initialized with 1024 bit key
Sun Jun 19 18:35:28 2011 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Sun Jun 19 18:35:28 2011 Socket Buffers: R=[42080->65536] S=[9216->65536]
Sun Jun 19 18:35:28 2011 ROUTE default_gateway=192.168.1.1
Sun Jun 19 18:35:28 2011 TUN/TAP device /dev/tun0 opened
Sun Jun 19 18:35:28 2011 /sbin/ifconfig tun0 delete
ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address
Sun Jun 19 18:35:28 2011 NOTE: Tried to delete pre-existing tun/tap instance -- No Problem if failure
Sun Jun 19 18:35:28 2011 /sbin/ifconfig tun0 10.8.0.1 10.8.0.2 mtu 1500 netmask 255.255.255.255 up
Sun Jun 19 18:35:28 2011 /sbin/route add -net 10.8.0.0 10.8.0.2 255.255.255.0 add net 10.8.0.0:
gateway 10.8.0.2
Sun Jun 19 18:35:29 2011 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Sun Jun 19 18:35:29 2011 GID set to nobody
Sun Jun 19 18:35:29 2011 UID set to nobody
Sun Jun 19 18:35:29 2011 UDPv4 link local (bound): [undef]:1194
Sun Jun 19 18:35:29 2011 UDPv4 link remote: [undef]
Sun Jun 19 18:35:29 2011 MULTI: multi_init called, r=256 v=256
Sun Jun 19 18:35:29 2011 IFCONFIG POOL: base=10.8.0.4 size=62
Sun Jun 19 18:35:29 2011 IFCONFIG POOL LIST
Sun Jun 19 18:35:29 2011 Initialization Sequence Completed