- Htun: HTun creates a VPN using HTTP-type request/response messages,
sent through a web-proxy server. In order to understand basic HTTP/1.1 or HTTP/1.0 messages, I reffered to
the book:
HTTP Essentials: Protocols for Secure, Scaleable Web Sites, by Stephen A. Thomas.
- The technical details for the HTun protocol can be obtained by reading the
HTun: Providing IP Service Over an HTTP Proxy
paper by the author of this VPN solution.
- Htun requires the following things to be present. They are:
- Tun/Tap driver: RedHat 8.0/9.0 kernels comes with support for
Tun/Tap driver. Hence you don't need to do anything to enable
kernel level support for it. If you do need to rebuild the kernel, take a look at the instructions
mentioned here.
- Proxy Server: Make sure that you have the proxy server up and running. I am using
squid, which comes bundled with RH 9.0.
I just had to add some commands to the access control list (ACL) in the squid configuration file
(/etc/squid/squid.conf) to provide access to my network. Since i intend to configure squid on
the machine spiff, I guess I will have to add the following lines to the ACCESS CONTROL section
of /etc/squid/squid.conf, to allow access to certain machines. You may need to modify some rules
for your environment.
--SNIP--
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
acl htun_ports port 8888 8889 #my Htund server listens on these ports.
http_access allow htun_ports
acl our_networks src 131.193.50.0/255.255.255.0 192.168.3.0/255.255.255.0
http_access allow our_networks
--SNIP--
NOTE: You may have to restart squid, if htun does not seem to work. Use the following command for
restarting:
#service squid restart
- Now download the tarball
and compile it using the instructions:
#>tar -xvzf htun-version.tar.gz
#>cd htun-version/src
#>make debug (This will allow logging debug messages.. )
#>cp htund /usr/local/bin
#>cp ../doc/htund.conf /etc
- I am asssuming that we are using the following setup with mia
as the client, zidler as the server and spiff as the proxy server .
- Configuration files are set up differently on the client and the server. They are
illustrated below. All the parameters are almost self-explanatory. If in question
refer to the README.
shashank@zidler:# cat /etc/htund.conf
options {
daemonize no
logfile /var/log/htund.log
tunfile /dev/net/tun
debug yes
}
server {
iprange 192.168.254.0/24
server_port 8888 #both server_port and secondary_port must be specified.
secondary_port 8889 #Make sure u have given access to these ports in squid.
max_clients 10
redirect_host mia.ece.uic.edu
redirect_port 80
max_pending 40
idle_disconnect 1800
clidata_timeout 20
min_nack_delay 150
packet_count_threshold 10
packet_max_interval 10
max_response_delay 200
}
--------------------------------------------
shashank@mia:#> cat /etc/htund.conf
options {
daemonize no
logfile /var/log/htund.log
tunfile /dev/net/tun
debug yes
}
client {
do_routing no
protocol 2
proxy_ip 131.193.50.187 #Ip address of spiff
proxy_port 3128 #Default port for squid
# Only uncomment proxy_user and proxy_pass if you need to authenticate with
# the proxy. Having them set unnecessarily creates extra HTTP overhead.
# proxy_user joeblow
# proxy_pass SuperSecret123
server_ip 131.193.50.184
server_port 8888
secondary_server_port 8889
if_name eth0
iprange 192.168.254.0/24
connect_tries 2
reconnect_tries 4
reconnect_sleep_sec 30
channel_2_idle_allow 30
min_poll_interval_msec 200
max_poll_interval 30
poll_backoff_rate 3
ack_wait 10
}
- Start the server(first) and client(second) using the command:
#>htund -d
- Check if the tunnel interface has come up.
[shashank@mia shashank]# ifconfig
--SNIP--
tun0 Link encap:Point-to-Point Protocol
inet addr:192.168.254.1 P-t-P:192.168.254.0 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:504 (504.0 b) TX bytes:504 (504.0 b)
- You will have to manually add routes to reach the other lan. For example, on zidler I use the command
shashank@zidler:# route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.254.1
Similarly on mia, I will use the command:
shashank@mia:# route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.254.0
- Also check if the routes have been established properly using netstat -rn command and ping.
- To kill htund, just use ps -A | grep htund, look at the process number and kill -9 processNumber.