From owner-freebsd-questions@FreeBSD.ORG Mon May 26 15:04:38 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95A9A106567B for ; Mon, 26 May 2008 15:04:38 +0000 (UTC) (envelope-from albert.bowen@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.245]) by mx1.freebsd.org (Postfix) with ESMTP id 499ED8FC0C for ; Mon, 26 May 2008 15:04:38 +0000 (UTC) (envelope-from albert.bowen@gmail.com) Received: by an-out-0708.google.com with SMTP id b33so461481ana.13 for ; Mon, 26 May 2008 08:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=Oyr4ePagQLGwXDjP3u1gWgT8kw5FWFH9O3npS2kaSzA=; b=YQ06Zqj8hsVi+Fy7iJW52186QarnowHPNSaBSv1GqZckA0eGcgQ63Guk0NoMox+bvTn6QQASgRILTP0YkgL+a95JieNkOUE0k6aoUW415Mh7WSJpCj8yVqQ7a4tR55RGuqIryl3zhEbBMFK+NtBrcwxzNqDLHLjTvvLuhFI7xqA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=KZe3hlqWFwRHuGASxjeE3Ul6cbMivZ6EtTRKediM+YaTIEo/rrndBWvN+BwIBLaESB59oRrqTMY7ln2niMK33pDK2UM4L06Rhon2bw2VzMwao/8/JURzuftoSps7IUfsKgcSgJIMATf80d4/5UDW7qrYRIKdH3PHsFfLTMYZ6JM= Received: by 10.100.140.1 with SMTP id n1mr241569and.32.1211814277471; Mon, 26 May 2008 08:04:37 -0700 (PDT) Received: by 10.100.13.10 with HTTP; Mon, 26 May 2008 08:04:37 -0700 (PDT) Message-ID: Date: Mon, 26 May 2008 23:04:37 +0800 From: "Xiaobo Zhu" To: "Christer Hermansson" In-Reply-To: <4826EC5A.8000203@chdevelopment.se> MIME-Version: 1.0 References: <4826330F.3020005@chdevelopment.se> <4826EC5A.8000203@chdevelopment.se> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-questions@freebsd.org Subject: Re: How to config ipv6 for this instance X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2008 15:04:38 -0000 Hi, After a long time of study, I make things clear on my mind and finally get ipv6 works on my FreeBSD, as well as linux platform. The configuration itself isn't to diffcult once you know it, but the long term of study is quite an unforgetable experience, So I'm glad to share it with you so that time can be saved if you just want to get ipv6 worked, instead of get deep into ipv6. If you have any suggestions or questions, feel free to contact subert.zhu# gmail.com. Any feedbacks are welcome The following step show how to configuration ipv6 on the top of ipv4. ==========Configuration for FreeBSD========= // Create an virtula interface named gif0 #ifconfig gif0 create // Specify the two end points of the tunnel, using ipv4 address. The first( 219.224.30.80 in this example) is the ipv4 address of your desktop, and the second address(202.112.95.129 in this example) is the ipv4 address of the remote server. #ifconfig gif0 tunnel 219.224.30.80 202.112.95.129 // Specify the two end points of the tunnel, using ipv6 address. The first is the address of your desktop, and the second is the address of the server. Prefixlen 128 means the tunnel is host to host. #ifconfig gif0 inet6 2001:da8:207:1:0:5efe:219.224.30.802001:da8:207:1:0:5efe: 202.112.95.129 prefixlen 128 // Add default ipv6 router to the host #route -n add -inet6 default 2001:da8:207:1:0:5efe:202.112.95.129 // Bring the interface gif0 up #ifconfig gif0 up // Check if the configuration is correct. #ping6 www.kame.net // If you want to make it automatically configured every time boot up, add the following lines to /etc/rc.conf ipv6_enable="YES" ipv6_defaultrouter="2001:da8:207:1:0:5efe:202.112.95.129" gif_interfaces="gif0" gifconfig_gif0="219.224.30.80 202.112.95.129" ipv6_ifconfig_gif0="2001:da8:207:1:0:5efe:219.224.30.802001:da8:207:1:0:5efe: 202.112.95.129 prefixlen 128" ==========Configuration for Linux========= // The following has only been tested on CentOS 5, but it should works on other linux distributions. // Please be aware that the ipv4 address is 172.16.120.226, instead of 219.224.30.80, I know you won't be confused. It is just on another computer. :) // Creat a ipv6-in-ipv4 tunnel named sit1, and specify the router's ipv4 address(202.112.95.129), as well as the client ipv4 add(172.16.120.226) # ip tunnel add sit1 mode sit remote 202.112.95.129 local 172.16.120.226 // Active the tunnel sit1 # ifconfig sit1 up // Asign ipv6 address to sit1 # ifconfig sit1 add 2001:da8:207:1:0:5efe:172.16.120.226/64 // Specify the default router # ip route add ::/0 via 2001:da8:207:1:0:5efe:ca70:5f81 metric 1 // Check if the configuration is correctly. # ping6 www.kame.net PING www.kame.net(orange.kame.net) 56 data bytes 64 bytes from orange.kame.net: icmp_seq=0 ttl=52 time=90.3 ms 64 bytes from orange.kame.net: icmp_seq=1 ttl=52 time=90.3 ms --- www.kame.net ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1000ms rtt min/avg/max/mdev = 90.340/90.364/90.389/0.301 ms, pipe 2 // If you wants to make ipv6 work every time you boot your linux, just add the same command to /etc/rc.local. As follows: # echo "ip tunnel add sit1 mode sit remote 202.112.95.129 local 172.16.120.226" >> /etc/rc.local # echo "ifconfig sit1 up" >> /etc/rc.local # echo "ifconfig sit1 add 2001:da8:207:1:0:5efe:172.16.120.226/64" >> /etc/rc.local # echo "ip route add ::/0 via 2001:da8:207:1:0:5efe:ca70:5f81 metric 1" >> /etc/rc.local good luck!