:: Setting up VPN using Yavipin :: | |||
HOME |
shashank@zidler:/etc/yavipin# yavipind -h yavipind version 0.9.5 Usage: yavipind [--help] (--responder|--initiator) --passwd=pwfile [--src=[addr][:port]] --dst=addr[:port] [--ifup script] [--ifdown script] [--comp] [--nodeamon] --src=[addr][:port] : specify the source addr and port --dst= addr[:port] : specify the destination addr and port --responder : be the tunnel responder --initiator : be the tunnel initiator --p pwfile : give the file's name containing the authentication password *** --ifup=script : give the script's filename to run when the tunnel goes UP --ifdown=script : give the script's filename to run when the tunnel goes DOWN --comp=DEFAULT : (DEFAULT | ZLIB) There is error in code. Hence this must be provided on cmdline *** --nodaemon : do not daemonize (usefull to debug) (Cannot use -f switch for this) *** --enc=algo : set a given algorithm for the packet encryption (DES-CBC(default) | BF-SBC) *** --mac=algo : set a given algorithm for the packet authentication (HMAC_MD5_96) *** --help : display this short inlined help --version : display the software version
shashank@zidler:/etc/yavipin# cat password abcd1234 ------------------------------------------------------------- shashank@zidler:/etc/yavipin# cat ip-up #!/bin/sh echo "[Yavipn].. ip-up script is run" ifconfig $1 192.168.254.201 netmask 255.255.255.255 route add -net 192.168.254.200 netmask 255.255.255.255 dev $1 route add -net 192.168.0.0 netmask 255.255.255.0 dev $1 ------------------------------------------------------------- shashank@zidler:/etc/yavipin# cat ip-down #!/bin/sh echo "[Yavipn].. ip-down script is run" route del -net 192.168.254.200 netmask 255.255.255.255 dev $1 route del -net 192.168.0.0 netmask 255.255.255.0 dev $1 ifconfig $1 down
[shashank@mia yavipin]# cat password abcd1234 ------------------------------------------------------------- [shashank@mia yavipin]# cat ip-up #!/bin/sh echo "[Yavipn].. ip-up script is run" ifconfig $1 192.168.254.200 netmask 255.255.255.255 route add -net 192.168.254.201 netmask 255.255.255.255 dev $1 route add -net 192.168.2.0 netmask 255.255.255.0 dev $1 ------------------------------------------------------------- [shashank@mia yavipin]# cat ip-down #!/bin/sh echo "[Yavipn].. ip-down script is run" route del -net 192.168.254.201 netmask 255.255.255.255 dev $1 route del -net 192.168.2.0 netmask 255.255.255.0 dev $1 ifconfig $1 down
shashank@zidler:~/temp/yavipn# ./yavipind --nodaemon --responder --src 131.193.50.184:6656 \ -p /etc/yavipin/password --ifup=/etc/yavipin/ip-up --ifdown=/etc/yavipin/ip-down --comp=ZLIB \ --enc=BF-SBC --mac=HMAC_MD5_96
shashank@mia:~/temp/yavipin-0.9.5# ./yavipind --nodaemon --initiator --dst 131.193.50.184:6656 \ -p /etc/yavipin/password --ifup=/etc/yavipin/ip-up --ifdown=/etc/yavipin/ip-down --comp=ZLIB \ --enc=BF-SBC --mac=HMAC_MD5_96
zidler#> ifconfig --SNIP-- tun0 Link encap:Point-to-Point Protocol inet addr:192.168.254.201 P-t-P:192.168.254.201 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1449 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:10 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) ----------------------------------------------------------------------------------- mia#> ifconfig --SNIP-- tun0 Link encap:Point-to-Point Protocol inet addr:192.168.254.200 P-t-P:192.168.254.200 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1449 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:10 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
6-byte Header 4-byte Compression Header n1-byte payload; n2-byte random padding; (Added to make [Header + Comp_header + payload + padding + padding_len] a multiple of BLOCK_SIZE for the cipher.) 1-byte padding_length. 12-byte MAC (message authentication code); MD5-96.
seq_no: 0 Y%*i%|\NU]\Dw-5jOba4Q@D8`?5t#"iBFna^M1OF)t?6++f)m6ZIR:aOY3EvO1Tu!7UhI&0R6O%\uked#BIpvGARZfd+3; "Olq9Q3J@J5E(,2m,5KVA^}bLse2 4gcVI}C\ccB4*J[VTg(;YIyr.Gg/Z#C]Y)OBs{AXYU}&2Ut6w1+CG kn#zdA?D6H/ U&$lGwG9vgeg]7a+C@R]-\z)]=b=nGLEMQ31dtJ\^K_Wc\b(|Pe+I{N(;3EEtqjC^9nD/:)"|aeZ_)s2n ['i}\8D#.7)k2B\Vl2su4qThis data was generated using modudpgen, a synonym for Modified UDP generator and sniffed using ethereal.
seq_no: 0 Y%*i%|\NU]\Dw-5jOba4Q@D8`?5t#"iBFna^M1OF)t?6++f)m6ZIR:aOY3EvO1Tu!7UhI&0R6O%\uked#BIpvGARZfd+3; "Olq9Q3J@J5E(,2m,5KVA^}bLse2 4gcVI}C\ccB4*J[VTg(;YIyr.Gg/Z#C]Y)OBs{AXYU}&2Ut6w1+CG kn#zdA?D6H/ U&$lGwG9vgeg]7a+C@R]-\z)]=b=nGLEMQ31dtJ\^K_Wc\b(|Pe+I{N(;3EEtqjC^9nD/:)"|aeZ_)s2n ['i}\8D#.7)k2B\Vl2su4qThis data was generated using modudpgen, a synonym for Modified UDP generator and sniffed using ethereal.
route add -net network/netmask gw gateway-ipAlthough the above method is simple for small networks, it becomes exceedingly difficult to maintain such routes one your network reaches a decent size (> 5 nodes, say). Hence one should avoid using this method, unless you have a very small network.