build立一个6in4隧道服务器

我想build立一个IPv6-in-IPv4 SIT隧道服务器。 我已经梳理了Ubuntu的IPv6 wiki页面,但是一切都是为了连接到一个作为客户端的隧道,而不是托pipe一个。 我想使用6in4,因为它非常简单/多function,似乎没有问题谈判大多数家庭路由器/防火墙。

这将主要由我们的系统pipe理员工使用本地支持的DSL /电缆连接从家里访问IPv6。 我想自己来运行的原因是双重的:

  1. 我发现喜欢飓风电隧道是相当缓慢,偶尔不可靠。
  2. 我不喜欢通过他的networkingstream量的想法。 我们有自己的核心传输networking和RIPE的IPv6分配,所以我们不妨利用它!

这将被5-10个用户同时使用。

我可以使用的设备可以用作主机:

  • 思科ISR
  • 思科ASA
  • 瞻博MX
  • Linux / Windows服务器(理想情况下是Ubuntu)

提前致谢。

如果我没有弄错,SIT是对称的:双方都做同样的事情。

configuration应该非常简单:

Cisco IOS:

interface Tunnel0 description 6in4 to <client> no ip address ipv6 enable ipv6 address 2001:db8:::1/64 tunnel source <local ipv4> tunnel destination <client ipv4 addr> tunnel mode ipv6ip 

Juniper JunOS

 interfaces { ip-0/1/0 { unit 0 { tunnel { source <local ipv4>; destination <client ipv4 addr>; } family inet6 { address 2001:db8::1/64; } } } } 

Linux iproute2:

 ip tunnel add tun-6in4 mode sit remote <client ipv4 addr> local <local ipv4> ip link set tun-6in4 up ip addr add 2001:db8:::1/64 dev tun-6in4 

我没有ASAconfiguration的经验,但也应该可行。

但是,6in4有几个缺点:

  • 在N节点的集线器节点上N个隧道

  • 没有简单的方法来更新dynamicIP客户端的对等IP。

你可能想看看dynamicVPN技术,比如OpenVPN(解决问题#2,尽pipe设备是dynamic生成的)或者tinc (解决了这两个问题),或者任何其他能够用tap设备封装以太网(因此是IPv6)的技术。

让ISP的家庭连接到IPv6的员工是非常重要的。

6in4是对称的,所以你在两端以同样的方式build立隧道(在它们之间形成一个虚拟的“电缆”)。 然后像往常一样进行路由:“客户”端使用隧道作为默认网关,“服务器”将前缀路由到相应的隧道。 最后一点可能需要一些(手动或自动)重新分配路线。

在Cisco IOS上,在路由协议中redistribute staticconfiguration是一个简单的方法,但是您可能需要过滤重新分配。 我通常在BGP中重新分配“客户”路由。 它保持IGP(如ISIS或OSPF)更清洁,这将有助于在链路振荡或故障后核心的收敛速度。 而且BGP提供了更好的过滤选项。 例如通过将社区附加到重新分配的路线。


扩展一下petrus给出的答案。 我会给思科表示法,但是这种方式也可以在其他操作系统中以相同的方式工作。

你可以有编号和无编号的链接。 编号的链接可能会使debugging更容易,但是这会使您的编址计划更加复杂一些。 在这两种情况下,你将不得不委托一些地址空间给用户。 链接上的地址仅用于链接,用户可能还需要链接后面的networking地址。 因此,沿着链路路由一个/56或一个/48


让我们从无编号的链接开始。 使用ipv6 enable创build链路,在链路上创build链路本地地址。 在“服务器”方面是这样的:

 interface Tunnel1 description 6in4 to <client-1> no ip address ipv6 enable tunnel source <local ipv4> tunnel destination <client-1 ipv4 addr> tunnel mode ipv6ip interface Tunnel2 description 6in4 to <client-2> no ip address ipv6 enable tunnel source <local ipv4> tunnel destination <client-2 ipv4 addr> tunnel mode ipv6ip ipv6 route 2001:db8:a001::/48 Tunnel 1 ipv6 route 2001:db8:a002::/48 Tunnel 2 router bgp 65530 address-family ipv6 redistribute static 

而在“客户”方面:

 interface Tunnel1 description 6in4 to <server> no ip address ipv6 enable tunnel source <client-1 ipv4> tunnel destination <server ipv4 addr> tunnel mode ipv6ip interface FastEthernet0/0 ipv6 address 2001:db8:a001:1::1/64 ipv6 route ::/0 Tunnel 1 

现在和编号链接完全一样。 好处是您可以更轻松地ping通隧道的另一端点。 在“服务器”方面是这样的:

 interface Tunnel1 description 6in4 to <client-1> no ip address ipv6 address 2001:db8:0:a001::1/64 tunnel source <local ipv4> tunnel destination <client-1 ipv4 addr> tunnel mode ipv6ip interface Tunnel2 description 6in4 to <client-2> no ip address ipv6 address 2001:db8:0:a002::1/64 tunnel source <local ipv4> tunnel destination <client-2 ipv4 addr> tunnel mode ipv6ip ipv6 route 2001:db8:a001::/48 2001:db8:0:a001::2 ipv6 route 2001:db8:a002::/48 2001:db8:0:a002::2 router bgp 65530 address-family ipv6 redistribute static redistribute connected 

而在“客户”方面:

 interface Tunnel1 description 6in4 to <server> no ip address ipv6 address 2001:db8:0:a001::2/64 tunnel source <client-1 ipv4> tunnel destination <server ipv4 addr> tunnel mode ipv6ip interface FastEthernet0/0 ipv6 address 2001:db8:a001:1::1/64 ipv6 route ::/0 2001:db8:0:a001::1 

为了方便起见,我select2001:db8:0:a001::/64作为与代理2001:db8:a001::/48相关的点到点链接。 你可以select任何你喜欢的前缀,但保持东西的可识别的地址空间一样大,IPv6可以帮助…