Hurricane Electric's IPv6 Tunnel Broker Forums

General IPv6 Topics => IPv6 Basics & Questions & General Chatter => Topic started by: dexter063 on February 04, 2011, 12:16:42 PM

Title: How to assign IPv6 from router to computer in LAN?
Post by: dexter063 on February 04, 2011, 12:16:42 PM
Hi,

I' ve got a small problem.
I have home network and router on Debian with nat.
eth0 - Internet with public IPv4
eth1 - home network 192.168.2.1/255.255.255.0
sit0 and sit1 configured from tunnelbroker site

What should I do to assign an IPv6 to computer connected to eth1?
Every computer in my network works on Debian or Ubuntu.

See you.
Title: Re: How to assign IPv6 from router to computer in LAN?
Post by: cholzhauer on February 04, 2011, 12:18:37 PM
You have a couple of options.

You can either manually or automatically assign an address.

If you want to do it automatically, you need to look into either RA (router advertisements) or DHCPv6.

If you want to do it manually, well you just need to manually assign an address to that interface.

In either event, be sure and use an IPv6 address from your routed /64 or your /48 (if you have one)
Title: Re: How to assign IPv6 from router to computer in LAN?
Post by: dexter063 on February 04, 2011, 12:41:51 PM
Ok.
To eth1 I should assign an ip with the end:
::3/48 and to computer in LAN assign ::4/48 and as gateway set ::3/48 ?
Title: Re: How to assign IPv6 from router to computer in LAN?
Post by: cholzhauer on February 04, 2011, 12:48:22 PM
Nope.

First, you don't want to use /48.  You need to take a /64 out of the /48 and use that for your network.  If you have more than one subnet/network, you need to select additional /64's from the /48

Leave your tunnel how it is.

If you wanted to make your eth1 ::3 and your routed /64 was something like 2001:db8:1234:5678::/64, the address would be 2001:db8:1234:5678::3/64

If you're doing RA, the gateway would be set automatically.

If you're doing it manually, then your gateway would be 2001:db8:1234:5678::3/64
Title: Re: How to assign IPv6 from router to computer in LAN?
Post by: dexter063 on February 04, 2011, 12:50:56 PM
Ok.

Yet one question, Using addresses in LAN with /48 is bad?
I know that autoconfigure IP need /64
Title: Re: How to assign IPv6 from router to computer in LAN?
Post by: cholzhauer on February 04, 2011, 12:51:48 PM
You want to use a /64 for a subnet regardless; that's the way ever OS expects to see it
Title: Re: How to assign IPv6 from router to computer in LAN?
Post by: dexter063 on February 04, 2011, 01:06:16 PM
It's my router's ifconfig:
dexter:~# ifconfig
dexter:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:c0:26:a4:fa:b5 
          inet addr:85.89.174.177  Bcast:85.89.174.255  Mask:255.255.255.128
          inet6 addr: fe80::2c0:26ff:fea4:fab5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:308 errors:0 dropped:0 overruns:0 frame:0
          TX packets:108 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:31736 (30.9 KiB)  TX bytes:9883 (9.6 KiB)
          Interrupt:11 Base address:0xc000

eth1      Link encap:Ethernet  HWaddr 00:1f:1f:89:18:77 
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::21f:1fff:fe89:1877/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:95 errors:0 dropped:0 overruns:0 frame:0
          TX packets:90 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11366 (11.0 KiB)  TX bytes:20080 (19.6 KiB)
          Interrupt:12 Base address:0xc400

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:72 errors:0 dropped:0 overruns:0 frame:0
          TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7516 (7.3 KiB)  TX bytes:7516 (7.3 KiB)

dexter:~# ifconfig sit0 up
dexter:~# ifconfig sit0 inet6 tunnel ::216.66.80.26
dexter:~# ifconfig sit1 up
dexter:~# ifconfig sit1 inet6 add 2001:470:1f08:12a9::2/64
dexter:~# route -A inet6 add ::/0 dev sit1
dexter:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:c0:26:a4:fa:b5 
          inet addr:85.89.***.***  Bcast:85.89.***.255  Mask:255.255.255.***
          inet6 addr: fe80::2c0:26ff:fea4:fab5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:400 errors:0 dropped:0 overruns:0 frame:0
          TX packets:111 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:37256 (36.3 KiB)  TX bytes:10105 (9.8 KiB)
          Interrupt:11 Base address:0xc000

eth1      Link encap:Ethernet  HWaddr 00:1f:1f:89:18:77 
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::21f:1fff:fe89:1877/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:131 errors:0 dropped:0 overruns:0 frame:0
          TX packets:114 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:14438 (14.0 KiB)  TX bytes:24408 (23.8 KiB)
          Interrupt:12 Base address:0xc400

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:72 errors:0 dropped:0 overruns:0 frame:0
          TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7516 (7.3 KiB)  TX bytes:7516 (7.3 KiB)

sit0      Link encap:IPv6-in-IPv4 
          inet6 addr: ::85.89.174.177/96 Scope:Compat
          inet6 addr: ::127.0.0.1/96 Scope:Unknown
          inet6 addr: ::192.168.2.1/96 Scope:Compat
          UP RUNNING NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

sit1      Link encap:IPv6-in-IPv4 
          inet6 addr: 2001:470:1f08:12a9::2/64 Scope:Global
          inet6 addr: fe80::5559:aeb1/64 Scope:Link
          inet6 addr: fe80::c0a8:201/64 Scope:Link
          UP POINTOPOINT RUNNING NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0


dexter:~# cat /etc/radvd.conf
interface eth1
{
AdvSendAdvert on;
MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;
prefix 2001:470:1f09:12a9::/64
{
AdvOnLink on;
AdvAutonomous on;
AdvRouterAddr on;
        };
};dexter:~#


and it's ifconfig of my computer connected to eth1 on router:
dexter@Stacjonarny-Linux:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:2f:58:b9:51 
          inet addr:192.168.2.100  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: 2001:470:1f09:12a9:211:2fff:fe58:b951/64 Scope:Global
          inet6 addr: fe80::211:2fff:fe58:b951/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:93798 errors:0 dropped:0 overruns:0 frame:0
          TX packets:101810 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:41496520 (41.4 MB)  TX bytes:13517044 (13.5 MB)
          Interrupt:22 Base address:0xd800

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:200 errors:0 dropped:0 overruns:0 frame:0
          TX packets:200 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:22185 (22.1 KB)  TX bytes:22185 (22.1 KB)

dexter@Stacjonarny-Linux:~$



But from my computer I can't open any webpage working on ipv6, eg. ipv6.google.com

What's bad?
Title: Re: How to assign IPv6 from router to computer in LAN?
Post by: dexter063 on February 04, 2011, 10:32:43 PM
Does anyone know what could be bad in my settings?
Title: Re: How to assign IPv6 from router to computer in LAN?
Post by: baryluk on February 05, 2011, 04:10:56 AM
startd radvd on router in debug mode (just stop radvd and then run it using radvd -d 5). be also sure to have ipv6 forwarding enabled nn this router (echo 1 > /proc/sys/net/ipv6/conf/all/forwarding).

on the computer in local network you can start radvdump, very usefull tool to monitor RA. You can eventually use "tcpdump -i eth0 -n" for the same purpose. Be also sure to make ipv6 forwarding DISABLED on this machine, as if it will have it enabled kernel will ignore RA packets, and will NOT autoconfigure addresses and routes.

below is simple config

interface eth0
{
AdvSendAdvert on;
MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;
prefix YOUR-64-BIT-PREFIX::1/64
{
AdvOnLink on;
AdvAutonomous on;
};
};



PS. It is also better to use iproute2 tools to configure networking in linux.   just call "ip a" to display everything about addresses, and "ip r" about routes. more info in manpages and help.

Title: Re: How to assign IPv6 from router to computer in LAN?
Post by: cholzhauer on February 06, 2011, 01:49:53 PM
I have a question...why are you using both sit0 and sit1?  Shouldn't those commands both go on one sit interface, like sit0?
Title: Re: How to assign IPv6 from router to computer in LAN?
Post by: snarked on February 06, 2011, 02:03:27 PM
No.  It should go to sit1 only.  Sit0 should be reserved to receive 6to4 (2002::/16) prefixed packets.
Title: Re: How to assign IPv6 from router to computer in LAN?
Post by: cholzhauer on February 06, 2011, 02:16:16 PM
Perfect...thanks, I had no idea.

So there you go, use sit1

(Snarked, any idea if that's the same for BSD types?  I wasn't able to make anything work with gif0, but when I moved to gif1, it worked with no problems)
Title: Re: How to assign IPv6 from router to computer in LAN?
Post by: snarked on February 07, 2011, 01:43:46 PM
I don't use BSD.  Sorry.