LINUX.ORG.RU
решено ФорумAdmin

IPv6 на роутере

 ,


1

1

Я настроил 6to4 на роутере, который на федорке. Теперь у меня пингуется ipv6.google.com. А что дальше? Как мне сделать так, чтобы компьютеры в сети начинали тоже работать по ipv6?

Правильно я понимаю, что то, что у меня делает dnsmasq (dhcp+dns proxy) будет делать radvd, то есть он будет оповещать всех «вот тот шлюз, это наша сеточка»? Ему в настройках надо указать префикс, глупый вопрос, но как его вычислить, зная IP?

★★★★★

Последнее исправление: CYB3R (всего исправлений: 1)

man radvd

то есть он будет оповещать всех «вот тот шлюз, это наша сеточка»?

Да.

но как его вычислить, зная IP?

Дык он уже в конце написан :)

tazhate ★★★★★
()
Ответ на: комментарий от tazhate
interface p4p1
{
        AdvSendAdvert on;
        MinRtrAdvInterval 30;
        MaxRtrAdvInterval 100;
        prefix  2002:5915:9d6e::0890:2115:7110/48
        {
                AdvOnLink on;
                AdvAutonomous on;
                AdvRouterAddr off;
        };

};

p12p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 19.22.45.10  netmask 255.255.0.0  broadcast 22.22.255.255
        inet6 fe80::fa1e:dfff:fef8:b56c  prefixlen 64  scopeid 0x20<link>
        ether f8:1e:df:f8:b5:6c  txqueuelen 1000  (Ethernet)
        RX packets 253350214  bytes 336967116047 (313.8 GiB)
        RX errors 0  dropped 12066  overruns 0  frame 0
        TX packets 112156296  bytes 17758704800 (16.5 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

p4p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.1  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::12bf:48ff:fe84:e374  prefixlen 64  scopeid 0x20<link>
        ether 10:bf:48:84:e3:74  txqueuelen 1000  (Ethernet)
        RX packets 241796678  bytes 181205571613 (168.7 GiB)
        RX errors 0  dropped 2618  overruns 0  frame 0
        TX packets 338271758  bytes 396728887093 (369.4 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tun6to4: flags=193<UP,RUNNING,NOARP>  mtu 1480
        inet6 ::89.21.157.110  prefixlen 128  scopeid 0x80<compat,global>
        inet6 2002:5915:9d6e::890:2115:7110  prefixlen 128  scopeid 0x0<global>
        sit  txqueuelen 0  (IPv6-in-IPv4)
        RX packets 8  bytes 832 (832.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8  bytes 832 (832.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Shaman007 ★★★★★
() автор топика
Ответ на: комментарий от Shaman007

Для каждого глобального адреса IPv4, выделена 48-битная 6to4 IPv6 приставка. Она может быть создана на основе IPv4 адреса. При этом адрес IPv4 ставится позади 2002::/16 приставки, но в шестнадцатеричном виде. Так IPv6 приставка для IPv4 адреса 192.0.2.4 будет равна 2002:C000:0204::/48.

tazhate ★★★★★
()
Ответ на: комментарий от tazhate

Ну, поставил этот префикс, не работает все равно.



en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=2b<RXCSUM,TXCSUM,VLAN_HWTAGGING,TSO4>
	ether 40:6c:8f:28:40:44 
	inet6 fe80::426c:8fff:fe28:4044%en0 prefixlen 64 scopeid 0x4 
	inet 192.168.2.10 netmask 0xffffff00 broadcast 192.168.2.255
	media: autoselect (1000baseT <full-duplex,flow-control>)
	status: active


iMac-Andrey:~ shaman007$ ping6 2001:ad0::1
ping6: UDP connect: No route to host
iMac-Andrey:~ shaman007$ ping6 ipv6.google.com
ping6: UDP connect: No route to host
iMac-Andrey:~ shaman007$
Shaman007 ★★★★★
() автор топика
Ответ на: комментарий от tazhate
[root@storage ~]# ps ax|grep radvd
 2358 ?        S      0:00 /usr/sbin/radvd -u radvd
 2360 ?        S      0:00 /usr/sbin/radvd -u radvd
 2458 pts/0    R+     0:00 grep --color=auto radvd
[root@storage ~]#

[root@storage ~]# sysctl -a|grep ipv6|grep forwa
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.all.mc_forwarding = 0
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.default.mc_forwarding = 0
net.ipv6.conf.lo.forwarding = 1
net.ipv6.conf.lo.mc_forwarding = 0
net.ipv6.conf.p12p1.forwarding = 1
net.ipv6.conf.p12p1.mc_forwarding = 0
net.ipv6.conf.p4p1.forwarding = 1
net.ipv6.conf.p4p1.mc_forwarding = 0
net.ipv6.conf.sit0.forwarding = 1
net.ipv6.conf.sit0.mc_forwarding = 0
net.ipv6.conf.tun6to4.forwarding = 1
net.ipv6.conf.tun6to4.mc_forwarding = 0
[root@storage ~]#

Shaman007 ★★★★★
() автор топика
Ответ на: комментарий от tazhate

то есть переконфигурить p4p1? А наружный можно оставить как есть? И какой адрес мне повесить на p4p1?

Shaman007 ★★★★★
() автор топика
Ответ на: комментарий от Shaman007

то есть переконфигурить p4p1?

да

А наружный можно оставить как есть?

да

И какой адрес мне повесить на p4p1?

2002:5915:9d6e::1

Если твой внешний ип 89.21.157.110

tazhate ★★★★★
()
Ответ на: комментарий от anonymous

6in4 годный, не?

Все равно через жопито маршрутизируется, емнип.
Плюс:

The 6in4 protocol has no security features, thus one can easily inject IPv6 packets by spoofing the source IPv4 address of a tunnel endpoint and sending it to the other endpoint.

tazhate ★★★★★
()
Ответ на: комментарий от tazhate

Вот, работает на компе в сети, если руками прописать шлюз и IP. Почему, интересно, не работает автоматом? radvd фигово настроен?

Shaman007 ★★★★★
() автор топика
Ответ на: комментарий от Shaman007

Ты мне точно тот префикс вычислил?

Ipv6 внутри себя содержит префикс, это часть адреса. Автоконфигурация во все поля, по идее.

tazhate ★★★★★
()
Ответ на: комментарий от tazhate

Вот автоконфигурация не работает. В ручную - ОК.

Shaman007 ★★★★★
() автор топика
Ответ на: комментарий от Shaman007

http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag],]<start-addr>[,<end-addr>][,<mode>][,<netmask>[,<broadcast>]][,<lease time>] 
-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag],]<start-IPv6addr>[,<end-IPv6addr>][,<mode>][,<prefix-len>][,<lease time>] 

 Enable the DHCP server. Addresses will be given out from the range <start-addr> to <end-addr> and from statically defined addresses given in dhcp-host options. If the lease time is given, then leases will be given for that length of time. The lease time is in seconds, or minutes (eg 45m) or hours (eg 1h) or "infinite". If not given, the default lease time is one hour. The minimum lease time is two minutes. For IPv6 ranges, the lease time maybe "deprecated"; this sets the preferred lifetime sent in a DHCP lease or router advertisement to zero, which causes clients to use other addresses, if available, for new connections as a prelude to renumbering.

ValdikSS ★★★★★
()
Ответ на: комментарий от Shaman007
For IPv6, the mode may be some combination of ra-only, slaac, ra-names, ra-stateless. 

ra-only tells dnsmasq to offer Router Advertisement only on this subnet, and not DHCP. 

slaac tells dnsmasq to offer Router Advertisement on this subnet and to set the A bit in the router advertisement, so that the client will use SLAAC addresses. When used with a DHCP range or static DHCP address this results in the client having both a DHCP-assigned and a SLAAC address. 

ra-stateless sends router advertisements with the O and A bits set, and provides a stateless DHCP service. The client will use a SLAAC address, and use DHCP for other configuration information.

Вам нужно slaac или ra-stateless

ValdikSS ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.