VPN

From Wikitech
Jump to navigation Jump to search

How to setup a VPN:

  • install pty-redir from /home/wikipedia/src on your local system
  • choose a free vpn network number, X (see /etc/hosts)
  • on your local system, run:
    • pty-redir /usr/bin/ssh -t -e none -o 'Batchmode yes' -c blowfish -i /home/ejb/.ssh/id_dsa kate@larousse.wikimedia.org pppd 10.254.X.1:10.254.X.2 netmask 255.255.255.0 >/tmp/vnp-device
    • /usr/sbin/pppd `cat /tmp/vpn-device`
  • on larousse:
    • echo 1 >/proc/sys/net/ipv4/conf/pppY/proxy_arp

If you want to route a network, setup proxy arp locally.

root@retribution:/home/ejb [pts/10] E0 J0 L3
164> traceroute vpnzwinger
traceroute to vpnzwinger (10.254.2.1), 30 hops max, 40 byte packets
 1  kate-vpn-severance-int (10.254.1.4)  0.165 ms   0.154 ms   0.142 ms
 2  kate-vpn-larousse (10.254.1.1)  130.553 ms   129.989 ms   295.396 ms
 3  vpnzwinger (10.254.2.1)  293.421 ms   291.428 ms   289.446 ms

my setup:

severance (router):

1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: sit0: <NOARP> mtu 1480 qdisc noop
    link/sit 0.0.0.0 brd 0.0.0.0
3: eth0: <BROADCAST,MULTICAST,PROMISC,NOTRAILERS,UP> mtu 1500 qdisc htb qlen 1000
    link/ether 00:04:75:cf:dc:66 brd ff:ff:ff:ff:ff:ff
    inet 80.3.244.236/24 brd 255.255.255.255 scope global eth0
    inet6 fe80::204:75ff:fecf:dc66/64 scope link
       valid_lft forever preferred_lft forever
5: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:c0:df:0d:95:1e brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.160/16 brd 192.168.255.255 scope global eth1
    inet 10.254.1.4/16 scope global eth1
    inet6 2001:618:400:20f0:2c0:dfff:fe0d:951e/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::2c0:dfff:fe0d:951e/64 scope link
       valid_lft forever preferred_lft forever
7: sixbone@NONE: <POINTOPOINT,NOARP,UP> mtu 1480 qdisc noqueue
    link/sit 80.3.244.236 peer 213.121.24.85
    inet6 2001:618:400::503:f4ec/128 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::5003:f4ec/128 scope link
       valid_lft forever preferred_lft forever
15: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP> mtu 1500 qdisc pfifo_fast qlen 3
    link/ppp
    inet 10.254.1.2 peer 10.254.1.1/32 scope global ppp0

10.254.1.1 dev ppp0  proto kernel  scope link  src 10.254.1.2
10.254.1.0/24 dev eth1  scope link
80.3.244.0/24 dev eth0  proto kernel  scope link  src 80.3.244.236
169.254.0.0/16 dev eth1  scope link
192.168.0.0/16 dev eth1  proto kernel  scope link  src 192.168.0.160
10.0.0.0/8 dev ppp0  scope link
127.0.0.0/8 dev lo  scope link
default via 80.3.244.254 dev eth0

retribution (client):

1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:20:ed:47:41:67 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.1/16 brd 192.168.255.255 scope global eth0
    inet 10.254.1.3/16 scope global eth0
    inet6 2001:618:400:20f0:220:edff:fe47:4167/64 scope global dynamic
       valid_lft 2591993sec preferred_lft 604793sec
    inet6 fe80::220:edff:fe47:4167/64 scope link
       valid_lft forever preferred_lft forever

169.254.0.0/16 dev eth0  scope link
10.254.0.0/16 dev eth0  proto kernel  scope link  src 10.254.1.3
192.168.0.0/16 dev eth0  proto kernel  scope link  src 192.168.0.1
127.0.0.0/8 dev lo  scope link
default via 192.168.0.160 dev eth0