| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: gre.4,v 1.40 2009/01/04 16:27:48 hubertf Exp $ | | 1 | .\" $NetBSD: gre.4,v 1.41 2009/01/04 16:30:17 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1998 The NetBSD Foundation, Inc. | | 3 | .\" Copyright (c) 1998 The NetBSD Foundation, Inc. |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | | 6 | .\" This code is derived from software contributed to The NetBSD Foundation |
7 | .\" by Heiko W.Rupp <hwr@pilhuhn.de> | | 7 | .\" by Heiko W.Rupp <hwr@pilhuhn.de> |
8 | .\" | | 8 | .\" |
9 | .\" Redistribution and use in source and binary forms, with or without | | 9 | .\" Redistribution and use in source and binary forms, with or without |
10 | .\" modification, are permitted provided that the following conditions | | 10 | .\" modification, are permitted provided that the following conditions |
11 | .\" are met: | | 11 | .\" are met: |
12 | .\" 1. Redistributions of source code must retain the above copyright | | 12 | .\" 1. Redistributions of source code must retain the above copyright |
13 | .\" notice, this list of conditions and the following disclaimer. | | 13 | .\" notice, this list of conditions and the following disclaimer. |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| @@ -214,70 +214,68 @@ On Router A: | | | @@ -214,70 +214,68 @@ On Router A: |
214 | # ifconfig greN create | | 214 | # ifconfig greN create |
215 | # ifconfig greN 192.168.1.1 192.168.2.1 | | 215 | # ifconfig greN 192.168.1.1 192.168.2.1 |
216 | # ifconfig greN tunnel A B | | 216 | # ifconfig greN tunnel A B |
217 | # route add -net 192.168.2 -netmask 255.255.255.0 192.168.2.1 | | 217 | # route add -net 192.168.2 -netmask 255.255.255.0 192.168.2.1 |
218 | .Ed | | 218 | .Ed |
219 | .Pp | | 219 | .Pp |
220 | On Router B: | | 220 | On Router B: |
221 | .Bd -literal | | 221 | .Bd -literal |
222 | # ifconfig greN create | | 222 | # ifconfig greN create |
223 | # ifconfig greN 192.168.2.1 192.168.1.1 | | 223 | # ifconfig greN 192.168.2.1 192.168.1.1 |
224 | # ifconfig greN tunnel B A | | 224 | # ifconfig greN tunnel B A |
225 | # route add -net 192.168.1 -netmask 255.255.255.0 192.168.1.1 | | 225 | # route add -net 192.168.1 -netmask 255.255.255.0 192.168.1.1 |
226 | .Ed | | 226 | .Ed |
227 | .Pp | | | |
228 | .Ss Example 3: Encapsulating GRE in UDP | | 227 | .Ss Example 3: Encapsulating GRE in UDP |
229 | To setup the same tunnel as above, but using GRE in UDP encapsulation | | 228 | To setup the same tunnel as above, but using GRE in UDP encapsulation |
230 | instead of GRE encapsulation, set flags | | 229 | instead of GRE encapsulation, set flags |
231 | .Ar link0 | | 230 | .Ar link0 |
232 | and | | 231 | and |
233 | .Ar link2 , | | 232 | .Ar link2 , |
234 | and specify source and destination UDP ports. | | 233 | and specify source and destination UDP ports. |
235 | .Pp | | 234 | .Pp |
236 | On Router A: | | 235 | On Router A: |
237 | .Bd -literal | | 236 | .Bd -literal |
238 | # ifconfig greN create | | 237 | # ifconfig greN create |
239 | # ifconfig greN link0 link2 | | 238 | # ifconfig greN link0 link2 |
240 | # ifconfig greN 192.168.1.1 192.168.2.1 | | 239 | # ifconfig greN 192.168.1.1 192.168.2.1 |
241 | # ifconfig greN tunnel A,port-A B,port-B | | 240 | # ifconfig greN tunnel A,port-A B,port-B |
242 | # route add -net 192.168.2 -netmask 255.255.255.0 192.168.2.1 | | 241 | # route add -net 192.168.2 -netmask 255.255.255.0 192.168.2.1 |
243 | .Ed | | 242 | .Ed |
244 | .Pp | | 243 | .Pp |
245 | On Router B: | | 244 | On Router B: |
246 | .Bd -literal | | 245 | .Bd -literal |
247 | # ifconfig greN create | | 246 | # ifconfig greN create |
248 | # ifconfig greN link0 link2 | | 247 | # ifconfig greN link0 link2 |
249 | # ifconfig greN 192.168.2.1 192.168.1.1 | | 248 | # ifconfig greN 192.168.2.1 192.168.1.1 |
250 | # ifconfig greN tunnel B,port-B A,port-A | | 249 | # ifconfig greN tunnel B,port-B A,port-A |
251 | # route add -net 192.168.1 -netmask 255.255.255.0 192.168.1.1 | | 250 | # route add -net 192.168.1 -netmask 255.255.255.0 192.168.1.1 |
252 | .Ed | | 251 | .Ed |
253 | .Pp | | | |
254 | .Ss Example 4: Realizing IPv6 connectivity | | 252 | .Ss Example 4: Realizing IPv6 connectivity |
255 | Along these lines, you can use GRE tunnels to interconnect two IPv6 | | 253 | Along these lines, you can use GRE tunnels to interconnect two IPv6 |
256 | networks over an IPv4 infrastructure, or to hook up to the IPv6 internet | | 254 | networks over an IPv4 infrastructure, or to hook up to the IPv6 internet |
257 | via an IPv4 tunnel to a Cisco router. | | 255 | via an IPv4 tunnel to a Cisco router. |
258 | .Bd -literal | | 256 | .Bd -literal |
259 | 2001:db8:1::/64 -- NetBSD A ---- Tunnel ---- Cisco B --- IPv6 Internet | | 257 | 2001:db8:1::/64 -- NetBSD A ---- Tunnel ---- Cisco B --- IPv6 Internet |
260 | \\ / | | 258 | \\ / |
261 | \\ / | | 259 | \\ / |
262 | +------ the Internet ------+ | | 260 | +------ the Internet ------+ |
263 | .Ed | | 261 | .Ed |
264 | .Pp | | 262 | .Pp |
265 | The example will use the following addressing: | | 263 | The example will use the following addressing: |
266 | .Bl -hang | | 264 | .Bl -hang |
267 | .It Nx A | | 265 | .It Nx A |
268 | has the IPv4 address A and the IPv6 address 2001:db8:1::1 (connects | | 266 | has the IPv4 address A and the IPv6 address 2001:db8:1::1 (connects |
269 | to internal network 2001:db8:1::/64). | | 267 | to internal network 2001:db8:1::/64). |
270 | .It Cisco B | | 268 | .It Cisco B |
271 | has external IPv4 address B. | | 269 | has external IPv4 address B. |
272 | .It All the IPv6 internet world | | 270 | .It All the IPv6 internet world |
273 | is behind B, so A wants to route 0::0/0 | | 271 | is behind B, so A wants to route 0::0/0 |
274 | (the IPv6 default route) into the tunnel. | | 272 | (the IPv6 default route) into the tunnel. |
275 | .It The GRE tunnel | | 273 | .It The GRE tunnel |
276 | will use a transit network: 2001:db8:ffff::1/64 on | | 274 | will use a transit network: 2001:db8:ffff::1/64 on |
277 | the | | 275 | the |
278 | .Nx | | 276 | .Nx |
279 | side, and ::2/64 on the Cisco side. | | 277 | side, and ::2/64 on the Cisco side. |
280 | .El | | 278 | .El |
281 | .Pp | | 279 | .Pp |
282 | Then the following commands will configure the tunnel: | | 280 | Then the following commands will configure the tunnel: |
283 | .Pp | | 281 | .Pp |