~ubuntu-branches/ubuntu/lucid/anytun/lucid

« back to all changes in this revision

Viewing changes to etc/anytun/server/post-up.sh

  • Committer: Bazaar Package Importer
  • Author(s): Michael Prokop
  • Date: 2009-12-14 02:08:25 UTC
  • Revision ID: james.westby@ubuntu.com-20091214020825-ntyi58y4wvsaglhi
Tags: upstream-0.3.2
ImportĀ upstreamĀ versionĀ 0.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
ip link set dev $1 up
 
3
ip link set mtu 1400 dev $1
 
4
 
 
5
# add tunnel addresses
 
6
ip addr add 192.168.123.254/24 dev $1
 
7
ip addr add fec0::fd/64 dev $1
 
8
 
 
9
# add routes to client subnets
 
10
# you also have to add these routes to the client configuration file of each client
 
11
# ip route add 192.168.11.0/24 dev $1
 
12
# ip route add fec0:1::/48 dev $1
 
13
# ip route add 192.168.12.0/24 dev $1
 
14
# ip route add fec0:2::/48 dev $1
 
15
# ip route add 192.168.13.0/24 dev $1
 
16
# ip route add fec0:3::/48 dev $1
 
17
 
 
18
# disable ICMP redirects as they don't work within the tunnel
 
19
echo 0 > /proc/sys/net/ipv4/conf/$1/send_redirects
 
20
echo 0 > /proc/sys/net/ipv4/conf/$1/accept_redirects
 
21
 
 
22
# enable packet forwarding
 
23
echo 1 > /proc/sys/net/ipv6/conf/$1/forwarding
 
24
echo 1 > /proc/sys/net/ipv4/conf/$1/forwarding
 
25
 
 
26
# enable routing to local ethernet interface
 
27
# echo 1 > /proc/sys/net/ipv6/conf/eth0/forwarding
 
28
# echo 1 > /proc/sys/net/ipv4/conf/eth0/forwarding
 
29
 
 
30
exit 0