NAT was never meant to be used as a form of network security; it was hacked together to forestall every single machine in the world requiring a globally-unique IPv4 address.It would work just like a IPv4 router. This cant be impossible with IPv6 ?
IPv6 seem to want to assign EVERYTHING a externaly accessable address. I dont need or want that. I like NAT.
This MUST be possible ?
/interface 6to4
add disabled=no local-address=aaa.bbb.ccc.ddd mtu=1480 name=6to4
/ipv6 address
add address=2002:AABB:CCDD:1::1/64 advertise=yes disabled=no eui-64=no interface=LAN
add address=2002:AABB:CCDD::1/16 advertise=no disabled=no eui-64=no interface=6to4
/ipv6 nd prefix default
set autonomous=yes
/ipv6 route
add disabled=no distance=1 dst-address=2000::/3 gateway=::192.88.99.1%6to4
Don't know about the OP, but in the UK, Andrews and Arnold have been providing native IPv6 for around about 6 years. See http://aaisp.net.uk/kb-broadband-ipv6.html.who is your ISP? never heard of any giving out native v6 yet so im curious.
/interface 6to4
add disabled=no local-address=192.0.2.1 name=6to4 remote-address=unspecified
/ipv6 address
add address=2002:c000:201::1/16 advertise=no comment=6to4public disabled=no \
eui-64=no interface=6to4
add address=2002:c000:201:dead::1/64 advertise=yes comment=6to4subnet \
disabled=no eui-64=no interface=LAN1
add address=2002:c000:201:beef::1/64 advertise=yes comment=6to4subnet \
disabled=no eui-64=no interface=LAN2
/ipv6 nd prefix default
set autonomous=yes preferred-lifetime=2m valid-lifetime=5m
/ipv6 route
add disabled=no distance=1 dst-address=2000::/3 gateway=::192.88.99.1%6to4
# settings begin:
:local WANinterface "WAN"
:local 6to4interface "6to4"
:local PubAddrComment "6to4public"
:local SubnetAddrComment "6to4subnet"
:local LogPrefix "6to4update: "
#settings end.
:local WANaddress
:set WANaddress [/ip address get [/ip address find interface=$WANinterface] address]
:set WANaddress [:pick [:tostr $WANaddress] 0 [:find [:tostr $WANaddress] "/"]]
:if ([:len $WANaddress] = 0) do={
:log error ($LogPrefix . "Could not get IP for interface " . $WANinterface)
:error ("Could not get IP for interface " . $WANinterface)
}
:if ([/interface 6to4 get ($6to4interface) local-address] != $WANaddress) do={
:log info ($LogPrefix . "Updating " . $6to4interface . " local-address with new IP " . $WANaddress . "...")
/interface 6to4 set ($6to4interface) local-address=$WANaddress
:set WANaddress ($WANaddress . ".")
:local IP6prefix "2002:"
:local num
:local tn
:local hi
:local lo
:local ar
:local pos
:local IP6part
:for i from=0 to=1 do={
:set IP6part ""
:for j from=0 to=1 do={
:set pos [:find $WANaddress "."]
:set num [:pick $WANaddress 0 $pos]
:set WANaddress [:pick $WANaddress ($pos + 1) 99]
:set tn [:tonum $num]
:set hi ($tn / 16)
:set lo ($tn - ($hi * 16))
:set ar [:toarray ($hi . "," . $lo)]
:foreach val in=$ar do={
:if ($val < 10) do={
:set IP6part ($IP6part . $val)
} else={
:if ($val = 10) do={ :set IP6part ($IP6part . "a") }
:if ($val = 11) do={ :set IP6part ($IP6part . "b") }
:if ($val = 12) do={ :set IP6part ($IP6part . "c") }
:if ($val = 13) do={ :set IP6part ($IP6part . "d") }
:if ($val = 14) do={ :set IP6part ($IP6part . "e") }
:if ($val = 15) do={ :set IP6part ($IP6part . "f") }
}
}
}
:set IP6prefix ($IP6prefix . $IP6part . ":")
}
:foreach i in=[/ipv6 address find] do={
:local addr [/ipv6 address get $i address]
:local cmnt [/ipv6 address get $i comment]
:local name [/ipv6 address get $i interface]
:if ($cmnt = $PubAddrComment) do={
:local newaddr ($IP6prefix . ":1/16")
/ipv6 address set $i address=$newaddr
:log info ($LogPrefix . "Changed address of interface " . $name . " from " . $addr . " to " . $newaddr)
}
:if ($cmnt = $SubnetAddrComment) do={
:local tmp $addr
:for j from=0 to=2 do={
:set pos [:find $tmp ":"]
:set tmp [:pick $tmp ($pos + 1) 99]
:if ($j = 2) do={
:set pos [:find $tmp ":"]
:local newaddr ($IP6prefix . [:pick $tmp 0 $pos] . "::1/64")
/ipv6 address set $i address=$newaddr
:log info ($LogPrefix . "Changed address of interface " . $name . " from " . $addr . " to " . $newaddr)
}
}
}
}
:log info ($LogPrefix . "Finished successfully.")
}
#EOF
/system scheduler
add comment="" disabled=no interval=5m name="Update 6to4" on-event=\
update6to4 policy=read,write start-date=jan/01/1970 start-time=00:00:00
Out of interest could you provide the configuration you use on your PPPoE interface?This is dual stack, so you receive IPv4 and IPv6 at the same time in the same xDSL line.
Only one provider is doing this, but i think that others will do this very soon.
I'm using IPv6 in production, PPPoE or Ethernet over router OS boxes, and it does works.
Here's where I run into problems at the moment, as even v5.0beta doesn't seem to have a way to get the dynamically advertised prefix from the remote end (which is how my ISP is handing out the IPv6 ranges).You need to know the /48 block delivered by your provider and the provider gateway. Those are not delivered automatically.
I think the nicer solution is too choose your IPv6 wan address in the same /126 sub-network than the provider gateway but choosing another one will normally work the same as soon as it is not an adress from a LAN /64 subnetwork you will use.
Unlike DHCPv4, DHCPv6 has a reconfigure capability where the server can announce to it's clients that they should renew their lease/pick up new information.I'm also not sure that your meant to dynamically change the v6 prefix handed out to the CPE as this would require an address update for every v6 device in the lan when the dsl/wifi/sat/whatever link drops
Yeah I can understand that *maybe* it won't change (would depend on the ISP). However at the moment there's no way to receive it in the first place.Have you actually checked if your prefix changes? DHCPv6 is something I havent played with in ROS yet but its meant to be coming in v5. If your prefix doesn't change (Which it shouldn't TBQH, There is no need for dynamic v6 ranges to client when an ISP has more IP's than the number of people on earth) just assign it on your Ethernet and be done with it