AtelierCanal2013 » Historique » Version 24
Laurent GUERBY, 27/01/2015 11:00
1 | 1 | Laurent GUERBY | {{>toc}} |
---|---|---|---|
2 | 1 | Laurent GUERBY | |
3 | 1 | Laurent GUERBY | h1. AtelierCanal2013 |
4 | 1 | Laurent GUERBY | |
5 | 2 | Laurent GUERBY | h2. Objectif |
6 | 2 | Laurent GUERBY | |
7 | 1 | Laurent GUERBY | Wifi pour les peniches du parc du canal a Ramonville |
8 | 1 | Laurent GUERBY | |
9 | 2 | Laurent GUERBY | Contact ok planet science pour test puis install |
10 | 1 | Laurent GUERBY | Contact TODO capitainerie via planet science |
11 | 2 | Laurent GUERBY | |
12 | 2 | Laurent GUERBY | h2. Routage |
13 | 2 | Laurent GUERBY | |
14 | 7 | Laurent GUERBY | L'idée est d'utiliser la connection internet d'un sympathisant (ici ADSL chez Planet Science) pour en faire un depart reseau 5 GHz avec un routage en IPv4 publique vers l'adherent sans en utiliser sur les intermediaires. Cela peut se faire facilement avec tunnel openwrt sur un PC Linux mais en pratique on peut aussi le faire avec un simple TP-Link 740N sous Openwrt qui a l'avantage d'un faible prix (16 euros) et faible encombrement/consomation, parfaitement silencieux. |
15 | 2 | Laurent GUERBY | |
16 | 3 | Laurent GUERBY | |
17 | 2 | Laurent GUERBY | h3. Sur le routeur gw a Paris |
18 | 2 | Laurent GUERBY | |
19 | 2 | Laurent GUERBY | qui a pour ip publique IP_ROUTEUR_PARIS |
20 | 2 | Laurent GUERBY | |
21 | 4 | Laurent GUERBY | <pre> |
22 | 2 | Laurent GUERBY | openvpn --mktun --dev-type tun --dev tunpsp |
23 | 2 | Laurent GUERBY | ip link set tunpsp up |
24 | 8 | Laurent GUERBY | openvpn --dev tunpsp --dev-type tun --cipher none --auth none --port PORT_NUMBER --verb 3 --proto tcp-server --daemon --log-append SOME_LOG --keepalive 10 60 |
25 | 2 | Laurent GUERBY | ip addr add 10.0.28.1/24 dev tunpsp |
26 | 2 | Laurent GUERBY | ip route add IP_PUBLIQUE/32 dev tunpsp |
27 | 4 | Laurent GUERBY | </pre> |
28 | 1 | Laurent GUERBY | |
29 | 8 | Laurent GUERBY | Ne pas oublier de mettre la route sur h3 (les dev tun ne se propagent pas par bird 1.2.x visiblement). |
30 | 8 | Laurent GUERBY | |
31 | 2 | Laurent GUERBY | h3. Sur le 740N a Planet science |
32 | 2 | Laurent GUERBY | |
33 | 7 | Laurent GUERBY | - port WAN branché sur le reseau local de planet science (donc la box ADSL) |
34 | 2 | Laurent GUERBY | - port LAN vers l'antenne 5 GHz AP |
35 | 2 | Laurent GUERBY | |
36 | 2 | Laurent GUERBY | network / interfaces |
37 | 2 | Laurent GUERBY | Wifi : disable |
38 | 2 | Laurent GUERBY | br-lan : IPv4 statique 192.168.1.1/24 + disable DHCP |
39 | 2 | Laurent GUERBY | wan : DHCP client |
40 | 2 | Laurent GUERBY | |
41 | 2 | Laurent GUERBY | system / software |
42 | 2 | Laurent GUERBY | install packages : openvpn-devel-nossl ip |
43 | 17 | Laurent GUERBY | Pour ipv6 : kmod-ipv6 ip6tables kmod-ip6tables radvd luci-app-radvd |
44 | 17 | Laurent GUERBY | adds implicitely: libip6tc libdaemon |
45 | 2 | Laurent GUERBY | |
46 | 2 | Laurent GUERBY | system / startup |
47 | 2 | Laurent GUERBY | openvpn disable |
48 | 2 | Laurent GUERBY | firewall disable |
49 | 2 | Laurent GUERBY | |
50 | 2 | Laurent GUERBY | system / startup / local startup |
51 | 2 | Laurent GUERBY | |
52 | 2 | Laurent GUERBY | <pre> |
53 | 2 | Laurent GUERBY | # Put your custom commands here that should be executed once |
54 | 2 | Laurent GUERBY | # the system init finished. By default this file does nothing. |
55 | 2 | Laurent GUERBY | |
56 | 2 | Laurent GUERBY | openvpn --mktun --dev-type tun --dev tunpsp |
57 | 1 | Laurent GUERBY | ip li set tunpsp up |
58 | 2 | Laurent GUERBY | ip a a 10.0.28.2/24 dev tunpsp |
59 | 8 | Laurent GUERBY | openvpn --dev tunpsp --dev-type tun --lport 0 --remote IP_ROUTEUR_PARIS PORT_NUMBER --proto tcp-client --daemon --keepalive 10 60 |
60 | 2 | Laurent GUERBY | |
61 | 2 | Laurent GUERBY | ip route add 10.0.28.0/24 dev tunpsp table 25 |
62 | 2 | Laurent GUERBY | ip route add default via 10.0.28.1 dev tunpsp table 25 |
63 | 1 | Laurent GUERBY | ip rule add from 10.0.28.2 table 25 |
64 | 2 | Laurent GUERBY | |
65 | 2 | Laurent GUERBY | ip route add IP_PUBLIQUE/32 dev br-lan |
66 | 8 | Laurent GUERBY | ip rule add from IP_PUBLIQUE/32 table 25 |
67 | 2 | Laurent GUERBY | |
68 | 2 | Laurent GUERBY | exit 0 |
69 | 2 | Laurent GUERBY | </pre> |
70 | 2 | Laurent GUERBY | |
71 | 2 | Laurent GUERBY | h3. Antennes AP et STA |
72 | 2 | Laurent GUERBY | |
73 | 2 | Laurent GUERBY | Les antennes 5 GHz sont en bridge avec des IP admin locales |
74 | 2 | Laurent GUERBY | 192.168.1.21/24 AP planet science |
75 | 2 | Laurent GUERBY | 192.168.1.22/24 STA adherent 1 |
76 | 2 | Laurent GUERBY | ... |
77 | 2 | Laurent GUERBY | |
78 | 2 | Laurent GUERBY | h3. Sur le 740N adherent |
79 | 2 | Laurent GUERBY | |
80 | 2 | Laurent GUERBY | sur routeur client |
81 | 1 | Laurent GUERBY | - port WAN sur l'antenne STA 5 GHz client |
82 | 1 | Laurent GUERBY | - port LAN et wifi = br-lan = reseau local |
83 | 7 | Laurent GUERBY | |
84 | 7 | Laurent GUERBY | system / software |
85 | 7 | Laurent GUERBY | *important* installer le paquet : ip |
86 | 2 | Laurent GUERBY | |
87 | 2 | Laurent GUERBY | network / interfaces |
88 | 2 | Laurent GUERBY | wan static address IP_PUBLIQUE/32 |
89 | 2 | Laurent GUERBY | use DNS IP_DNS |
90 | 2 | Laurent GUERBY | |
91 | 2 | Laurent GUERBY | system / startup / local startup |
92 | 2 | Laurent GUERBY | <pre> |
93 | 2 | Laurent GUERBY | # Put your custom commands here that should be executed once |
94 | 2 | Laurent GUERBY | # the system init finished. By default this file does nothing. |
95 | 2 | Laurent GUERBY | |
96 | 2 | Laurent GUERBY | ip route add 192.168.1.0/24 dev eth1 |
97 | 2 | Laurent GUERBY | ip route add default via 192.168.1.1 |
98 | 2 | Laurent GUERBY | |
99 | 2 | Laurent GUERBY | exit 0 |
100 | 1 | Laurent GUERBY | </pre> |
101 | 6 | Laurent GUERBY | |
102 | 6 | Laurent GUERBY | h2. IPv6 |
103 | 6 | Laurent GUERBY | |
104 | 6 | Laurent GUERBY | TODO |
105 | 5 | Laurent GUERBY | |
106 | 5 | Laurent GUERBY | h2. Modele financier |
107 | 5 | Laurent GUERBY | |
108 | 5 | Laurent GUERBY | * 20 (740N sur box) + 60 (LocoM5 AP) = 80 euros de setup (+ cables) |
109 | 5 | Laurent GUERBY | * 20 (740N LAN adherent) + 60 (LocoM5 STA) = 80 euros/adherent (+ cables) |
110 | 5 | Laurent GUERBY | * participation eventuelle a la connection ADSL du local |
111 | 5 | Laurent GUERBY | * total 160 euros + cables + participation |
112 | 5 | Laurent GUERBY | |
113 | 5 | Laurent GUERBY | Pour 1 adherent 160 euros, 8 mois d'amortissement avec 20/mois |
114 | 5 | Laurent GUERBY | Pour 2 adherents 240 euros, 6 mois d'amortissement avec 20+20/mois |
115 | 16 | Laurent GUERBY | |
116 | 16 | Laurent GUERBY | h2. Liens |
117 | 16 | Laurent GUERBY | |
118 | 16 | Laurent GUERBY | http://wiki.freifunk.net/images/7/73/Vortrag.pdf |
119 | 16 | Laurent GUERBY | <pre> |
120 | 16 | Laurent GUERBY | echo 50 XY »/etc/iproute2/rt tables |
121 | 16 | Laurent GUERBY | ip rule add from $HNA/$MSK prio 30002 table XY |
122 | 16 | Laurent GUERBY | ip rule add to $HNA/$MSK prio 30001 lookup main |
123 | 16 | Laurent GUERBY | ip route add default \ |
124 | 16 | Laurent GUERBY | via $TUNNEL NEIGH IP \ |
125 | 16 | Laurent GUERBY | dev $TUNNEL DEV \ |
126 | 16 | Laurent GUERBY | table XY |
127 | 16 | Laurent GUERBY | ip route flush cache |
128 | 16 | Laurent GUERBY | |
129 | 16 | Laurent GUERBY | |
130 | 16 | Laurent GUERBY | ip tunnel \ |
131 | 16 | Laurent GUERBY | add tunnel0 \ |
132 | 16 | Laurent GUERBY | mode ipip \ |
133 | 16 | Laurent GUERBY | remote 10.10.1.1 \ |
134 | 16 | Laurent GUERBY | local 10.10.99.1 \ |
135 | 16 | Laurent GUERBY | compress lzo |
136 | 16 | Laurent GUERBY | ip link set dev ipip0 up |
137 | 16 | Laurent GUERBY | ip address add 172.16.1.2/24 dev tunnel0 |
138 | 16 | Laurent GUERBY | </pre> |
139 | 18 | Laurent GUERBY | |
140 | 18 | Laurent GUERBY | h2. Version 2014 |
141 | 18 | Laurent GUERBY | |
142 | 18 | Laurent GUERBY | Rue de l'ukraine |
143 | 18 | Laurent GUERBY | |
144 | 18 | Laurent GUERBY | Sur h7 : |
145 | 18 | Laurent GUERBY | <pre> |
146 | 18 | Laurent GUERBY | openvpn --mktun --dev-type tun --dev tunukr |
147 | 18 | Laurent GUERBY | ip link set tunukr up |
148 | 19 | Laurent GUERBY | openvpn --dev tunukr --dev-type tun --cipher none --auth none --port 65114 --verb 3 --proto udp --local 91.224.148.1 --daemon --log-append /root/vpn/65114.log --keepalive 10 60 |
149 | 18 | Laurent GUERBY | ip addr add 10.0.129.1/24 dev tunukr |
150 | 18 | Laurent GUERBY | ip route add 172.31.129.0/24 dev tunukr |
151 | 18 | Laurent GUERBY | </pre> |
152 | 18 | Laurent GUERBY | |
153 | 18 | Laurent GUERBY | Sur 740N rc.local : |
154 | 18 | Laurent GUERBY | |
155 | 18 | Laurent GUERBY | <pre> |
156 | 18 | Laurent GUERBY | openvpn --mktun --dev-type tun --dev tunukr |
157 | 18 | Laurent GUERBY | ip link set tunukr up |
158 | 18 | Laurent GUERBY | ip addr add 10.0.129.2/24 dev tunukr |
159 | 18 | Laurent GUERBY | openvpn --dev tunukr --dev-type tun --lport 0 --remote 91.224.148.1 65114 --proto udp --daemon --keepalive 10 60 |
160 | 18 | Laurent GUERBY | |
161 | 18 | Laurent GUERBY | ip route add default dev tunukr table 25 |
162 | 18 | Laurent GUERBY | ip -6 route add default dev tunukr table 25 |
163 | 20 | Laurent GUERBY | ip route add 172.31.129.0/24 dev br-lan table 25 |
164 | 18 | Laurent GUERBY | |
165 | 18 | Laurent GUERBY | ip rule add from 10.0.129.2 table 25 |
166 | 18 | Laurent GUERBY | ip rule add from 172.31.129.0/24 lookup 25 |
167 | 18 | Laurent GUERBY | |
168 | 18 | Laurent GUERBY | ip addr add 89.234.156.0/32 dev br-lan |
169 | 18 | Laurent GUERBY | ip -6 addr add fe80::31/64 dev br-lan |
170 | 18 | Laurent GUERBY | </pre> |
171 | 18 | Laurent GUERBY | |
172 | 18 | Laurent GUERBY | WAN: DHCP |
173 | 18 | Laurent GUERBY | LAN: 172.31.129.1/24 |
174 | 21 | Laurent GUERBY | |
175 | 21 | Laurent GUERBY | h2. Version 2015 |
176 | 21 | Laurent GUERBY | |
177 | 21 | Laurent GUERBY | Sur le 740N de routage ADSL Montescot |
178 | 21 | Laurent GUERBY | |
179 | 24 | Laurent GUERBY | packages a installer sur attitude adjustment : openvpn-devel-nossl ip kmod-ipv6 |
180 | 24 | Laurent GUERBY | <pre> |
181 | 24 | Laurent GUERBY | opkg update |
182 | 24 | Laurent GUERBY | opkg install openvpn-devel-nossl ip kmod-ipv6 |
183 | 24 | Laurent GUERBY | </pre> |
184 | 24 | Laurent GUERBY | |
185 | 24 | Laurent GUERBY | Attention : j'utilise OpenWRT attitude adjustment 12.09 pour les 740N de tunnel car avec barrier breaker /etc/rc.local s'execute avant le up des interfaces reseau. J'ai pas cherché a creuser, il doit y avoir une solution en y passant un peu de temps (d'un autre coté la 12.09 est extraordinairement stable avec le setup tunnel, on n'a jamais eu le moindre soucis et des uptime > 6 mois). |
186 | 24 | Laurent GUERBY | |
187 | 24 | Laurent GUERBY | |
188 | 21 | Laurent GUERBY | <pre> |
189 | 21 | Laurent GUERBY | openvpn --mktun --dev-type tun --dev tunmts |
190 | 21 | Laurent GUERBY | ip link set tunmts up |
191 | 22 | Laurent GUERBY | openvpn --dev tunmts --dev-type tun --lport 0 --proto udp --daemon --remote IP PORT --keepalive 10 60 |
192 | 21 | Laurent GUERBY | ip addr add 10.0.200.2/24 dev tunmts |
193 | 21 | Laurent GUERBY | |
194 | 21 | Laurent GUERBY | |
195 | 21 | Laurent GUERBY | ip route add default dev tunmts table 25 |
196 | 21 | Laurent GUERBY | ip -6 route add default dev tunmts table 25 |
197 | 21 | Laurent GUERBY | |
198 | 21 | Laurent GUERBY | ip rule add from all iif tunmts table 25 |
199 | 21 | Laurent GUERBY | ip -6 rule add from all iif tunmts table 25 |
200 | 21 | Laurent GUERBY | |
201 | 21 | Laurent GUERBY | ip rule add from all iif br-lan table 25 |
202 | 21 | Laurent GUERBY | ip -6 rule add from all iif br-lan table 25 |
203 | 21 | Laurent GUERBY | |
204 | 21 | Laurent GUERBY | ip rule add from 10.0.200.2 table 25 |
205 | 21 | Laurent GUERBY | |
206 | 21 | Laurent GUERBY | ip route add 172.31.200.0/24 dev br-lan table 25 |
207 | 21 | Laurent GUERBY | |
208 | 21 | Laurent GUERBY | ip -6 addr add fe80::31/64 dev br-lan |
209 | 21 | Laurent GUERBY | ip addr add 89.234.156.0/32 dev br-lan |
210 | 21 | Laurent GUERBY | |
211 | 21 | Laurent GUERBY | |
212 | 21 | Laurent GUERBY | ip route add 89.234.156.35/32 dev br-lan table 25 |
213 | 21 | Laurent GUERBY | ip -6 route add 2a01:6600:8083:2300::/56 via fe80::83:23 dev br-lan table 25 |
214 | 21 | Laurent GUERBY | |
215 | 21 | Laurent GUERBY | </pre> |
216 | 23 | Laurent GUERBY | |
217 | 23 | Laurent GUERBY | |
218 | 23 | Laurent GUERBY | Pour une machine Linux ne pas oublier : |
219 | 23 | Laurent GUERBY | |
220 | 23 | Laurent GUERBY | <pre> |
221 | 23 | Laurent GUERBY | echo 1 > /proc/sys/net/ipv4/ip_forward |
222 | 23 | Laurent GUERBY | for i in /proc/sys/net/ipv6/conf/*; do for j in autoconf accept_ra; do echo 0 > $i/$j; done;done |
223 | 23 | Laurent GUERBY | echo 1 > /proc/sys/net/ipv6/conf/all/forwarding |
224 | 23 | Laurent GUERBY | </pre> |