Differences
This shows you the differences between two versions of the page.
docs:vpn:building_openvpn [2013/09/21 22:06] – created billh | docs:vpn:building_openvpn [2013/09/21 22:07] (current) – removed billh | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== building openvpn ====== | ||
- | ===== 12/21/2012 ===== | ||
- | * downloaded source from | ||
- | * http:// | ||
- | * tried typical build procedure, but it complained about LZO: '' | ||
- | * downloaded LZO source from mirror shown at http:// | ||
- | * built LZO using typical build procedure, then ran sudo make install | ||
- | * typical build procedure now ran on openvpn, but make failed with this:< | ||
- | socket.c: In function ‘create_socket_udp’: | ||
- | undeclared (first use in this function) socket.c: | ||
- | identifier is reported only once socket.c: | ||
- | appears in.) socket.c: In function ‘link_socket_read_udp_posix_recvmsg’: | ||
- | socket.c: | ||
- | socket.c: In function ‘link_socket_write_udp_posix_sendmsg’: | ||
- | error: ‘SOL_IP’ undeclared (first use in this function) make[2]: *** | ||
- | [socket.o] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error | ||
- | 2</ | ||
- | * patched syshead.h similar to the following (actual patch info was from another version of the source) Index:< | ||
- | dports/ | ||
- | =================================================================== --- | ||
- | dports/ | ||
- | dports/ | ||
- | +diff -ur syshead.h syshead.h +--- syshead.h | ||
- | -0700 ++++ syshead.h | ||
- | @@ + #endif + + /* ++ * Define a proper IP socket level if not already done. | ||
- | ++ */ ++#ifndef SOL_IP ++#define SOL_IP IPPROTO_IP ++#endif ++ ++/* + * | ||
- | Disable ESEC + */ + #if 0 +</ | ||
- | * reran make, completed successfully, | ||
- | * nothing further was done at this time to run it, other than looking at the help | ||
- | |||
- | ====== 12/22/2012 ====== | ||
- | * downloaded command line tools only from Apple to get gcc (this is since we updated to Lion and didn't want to wait to download a new xcode) | ||
- | * built openvpn the same as before | ||
- | * tried to set up some configuration files for client and server, but it wouldn' | ||
- | * downloaded binaries for tun/tap from http:// | ||
- | * installed binaries on both laptop and mini | ||
- | * set up port forwarding on the router to the mini at port 1194 | ||
- | * set up successful connection by using easytether on the mobile phone connected to the laptop with wifi disabled | ||
- | * however, even though we could do things like ssh and screen sharing to 192.168.3.250, | ||
- | |||
- | ====== 12/27/2012 ====== | ||
- | * enabled ip forwarding on the mac:< | ||
- | sudo sysctl -w net.inet.ip.forwarding=1 | ||
- | </ | ||
- | * on the server, the proto udp line was changed to proto tcp-server | ||
- | * on the client, the proto udp line was changed to proto tcp-client | ||
- | * on the router, under Advanced Routing, added a route for 10.8.0.0, 255.255.255.0 to have a gateway of 192.168.3.109 | ||
- | * the push route command in the server config would not add a route on the client, so we had to add "route 192.168.3.0 255.255.255.0" | ||
- | * network resources on the server lan are now available to the client | ||
- | * changed default port to something else for security | ||
- | * set up tunnelblick to start the server automatically at boot, after changing the tunnelblick configuration from private to shared | ||
- | * after reboot, the ip forwarding setting didn't stay, so we had to create an / | ||
- | net.inet.ip.forwarding=1 | ||
- | </ | ||
- | |||
- | ====== finished client configuration file ====== | ||
- | < | ||
- | mode p2p | ||
- | proto tcp-client | ||
- | dev tun | ||
- | #remote <my external IP> 1194 | ||
- | remote <my external IP> <changed to a randomly selected port number here, very high> | ||
- | ifconfig 10.8.0.2 10.8.0.1 | ||
- | verb 3 | ||
- | secret <path to my secret key file> | ||
- | comp-lzo | ||
- | |||
- | # this route combined with a route for 10.8.0.0 to point to 192.168.3.109 on my | ||
- | # router allows the vpn client to access all lan resources of the server | ||
- | route 192.168.3.0 255.255.255.0 | ||
- | |||
- | # these lines were supposed to make the connection more resistant to failures | ||
- | keepalive 10 60 | ||
- | ping-timer-rem | ||
- | persist-tun | ||
- | persist-key | ||
- | </ | ||
- | |||
- | ====== finished server configuration file ====== | ||
- | < | ||
- | mode p2p | ||
- | proto tcp-server | ||
- | dev tun | ||
- | #port 1194 | ||
- | port <changed to a randomly selected port number here, very high> | ||
- | ifconfig 10.8.0.1 10.8.0.2 | ||
- | verb 3 | ||
- | secret <path to my secret key file> | ||
- | comp-lzo | ||
- | |||
- | # these lines were supposed to make the connection more resistant to failures | ||
- | keepalive 10 60 | ||
- | ping-timer-rem | ||
- | persist-tun | ||
- | persist-key | ||
- | |||
- | # couldn' | ||
- | # the route in the client config file | ||
- | #push "route 192.168.3.0 255.255.255.0" | ||
- | </ |