News for hackers. Stuff that matters.
Re:Linux gets IPv6 NAT by kenny_r on Monday November 21, 2011 @08:08AM (#3260955)
I'd be interested to hear some of these legitimate use cases for IPv6 NAT.
Re:Linux gets IPv6 NAT by agwa on Monday November 21, 2011 @10:40AM (#3261445)
I suspect that there will still exist some situations where you only have a /128 but need to run a network behind it. I realize I'm in a tiny minority here, but when I travel I bring a WRT54GL, plug it into the hotel's Internet connection, and then plug my devices into it on my own private subnet. I kinda doubt hotels will be routing /64 to their guests, so NAT will be the only option.

I hope that IPv6 NAT will be used rarely, but I'm grateful that I will have it in my toolbox for atypical situations where there are no other options.

Re:Linux gets IPv6 NAT by loup-vaillant on Monday November 21, 2011 @12:19PM (#3261854)
Noob question: what exactly are a /128 and a /64 ? How many public IPs do they provide? Do you have a link so I can learn how to interpret those /xx?

Originally, I was under the impression that /n subnets have 2^n public IPs at there disposal. Could it be 2^(128-n) instead?

But either way, a /64 should be plenty. However, you suggest here http://news.ycombinator.com/item?id=3261500 that /64 are not so great. I wonder why. Is there something special going on?

Re:Linux gets IPv6 NAT by count on Monday November 21, 2011 @12:31PM (#3261903)
A /64 is a 64-bit network mask on the 128bit ipv6 address, effectively leaving you with 64 bits for host addresses on that subnet. A /128 is a 128bit mask, leaving you with 0 extra bits (ie: a single host address).

2^(128-n) is the way it works for HOST addresses (no '-1', as in ipv4, as there is no broadcast address in ipv6, and 128-128=0, so 2^0=1, a single host address). 2^n is the way it works for networks/subnets, so a /128 leaves 2^128 possible networks, each with 2^0 hosts on them, while a /127 leaves 2^127 networks, each with 2^1 hosts on them.

A /64 is equal to the square of the entire existent ipv4 space (/32), and should be more than enough for any subnet anywhere, ever (it's roughly 18,446,744,073,709,551,615 IPs).

The issue is that many of the 'fundamental' protocols are built on assumptions that the smallest network will be a /64, and if your ISP gives you 1 /64, you can't have more than one 'network' on your end of the connection - even if you can have 18 quintillion addresses, they all have to be on the same subnet, so no fire-walling/etc. within your network.

Re:Linux gets IPv6 NAT by agwa on Monday November 21, 2011 @02:19PM (#3262389)
This is a good explanation. To elaborate on the /64 network assumption, it has to do with stateless autoconfiguration, which is the way of configuring IPv6 addresses. An IPv6 address is comprised of a 64 bit prefix followed by a 64 bit "interface ID." The interface ID is inherent to an interface, and is derived from the MAC address, since it is guaranteed to be globally unique. When you bring up an interface, the OS listens for router advertisements which contain the 64 bit prefix. It takes this prefix and appends the interface ID to generate a full IPv6 address which is unique.

This is really cool because it means your computer will always have the same lower 64 bits no matter where you take it, and it can auto-discover the prefix without the complexities of DHCP. (Note that there were some concerns about tracking computers using the lower 64 bits, which led to the optional privacy extensions, under which the interface ID is randomly generated.)

However, the standard requires that the interface ID be 64 bits, so if you only have a /64 from your ISP you are, practically speaking, limited to 1 subnet. For this reason, I like to measure prefix lengths in terms of subnets rather than IPv6 addresses.

Re:Linux gets IPv6 NAT by count on Tuesday November 22, 2011 @11:09AM (#3266016)
It's way more than stateless autoconfig - privacy addresses and a host of other protocols assume the last /64 is a host address and flexible.

What a horrible assumption to tack on though - it should have been codified in the v6 RFC if that's how it's going to work.

Re:Linux gets IPv6 NAT by dspillett on Monday November 21, 2011 @09:33AM (#3261208)
The only ones I can think of are:

1. Topology hiding: the outside world only sees one interface not potentially the rest of your network. Though I doubt this offers and security worth speaking of, some people might want to keep that part of their arrangement when they migrate from IPv4 to IPv6.

2. Selective address forwarding: your router could send packets for a particular IPv6 address to different machines LAN-side depending on various things like where the packets came from WAN-side.

Of course there might be better ways to implement these things in the IPv6 spec already, I'm very behind the times in that respect and really must find time to read up on the subject (I purposely chose an ISP that fully supports IPv6 when I switched a few months ago, so I could try it all out when I have some time to play)

Re:Linux gets IPv6 NAT by throwaway64 on Monday November 21, 2011 @01:32PM (#3262198)
a firewall can handle both those things without NAT
Re:Linux gets IPv6 NAT by dspillett on Tuesday November 22, 2011 @10:01AM (#3265715)
In the case of splitting traffic between two hosts depending on some factor, what if you want outgoing requests from those services to appear to come from the same place (so the two machine appear to be one interface for outgoing connections as well as incoming ones)?

You could use some sort of proxy services the the machines make the requests through (and the passes incoming requests back - you can avoid NAT in both directions that way) of course, but NAT seems (to me) to be a lighter solution for that use case.

Re:Linux gets IPv6 NAT by zobzu on Monday November 21, 2011 @09:07AM (#3261129)
responses you might get (not that i agree):

"we're used to the false sense of security from NAT and we like it"

"we feel like NAT protects our privacy ('but we use gmail')"

"its easier to setup than ndp proxying ('because i never heard of ndp before')"

yada yada :-)

Re:Linux gets IPv6 NAT by guan on Monday November 21, 2011 @08:57AM (#3261095)
I don't know if this qualifies as legitimate, but Comcast has already decided to allocate /128 to customers with "directly connected CPE", which sounds like people who have just a cable modem and didn't pay for a "home gateway device". NAT could be useful if you plug that cable modem into a Linux box.

http://blog.comcast.com/2011/11/ipv6-deployment-technology.h...

Re:Linux gets IPv6 NAT by wmf on Monday November 21, 2011 @09:35AM (#3261215)
You're interpreting it wrong; Comcast is going to provide at least /64 to each customer but they just haven't turned on prefix delegation yet.
Re:Linux gets IPv6 NAT by agwa on Monday November 21, 2011 @10:53AM (#3261500)
/64 is almost as bad and will lead to IPv6 NATing. What if you want multiple subnets (for example, a separate guest network, which some high-end consumer access points already tout as a selling point)? You don't want to sub-divide your /64 because then stateless auto configuration won't work. You could bridge multiple subnets with the same /64 prefix and use a layer 2 firewall (ebtables in Linux), but that's ugly. NAT is the only other option.

That said, Comcast did leave open the possibility for shorter prefixes, possibly as early as 2012, and they have already received quite a thrashing on their IPv6 beta tester forums for using /64 prefixes. So they might eventually do the right thing. I'm optimistic :-).

Re:Linux gets IPv6 NAT by pasbesoin on Monday November 21, 2011 @10:44AM (#3261472)
My opinion is that when you're dependent upon a (possibly recalcitrant) upstream provider, it's best to have means of dealing with whatever they give you.

If in some circumstance someone hands you only one address (or, one address too few, perhaps), you can still hang your own network behind it.

Re:Linux gets IPv6 NAT by syncsynchalt on Monday November 21, 2011 @11:22AM (#3261610)
I think you're reading that wrong. The CPE (the cable modem itself) gets a /128, similar to the 10.0.0.0/8 address that it currently gets (that is not visible to the end user). They then go on to say that the home gateway gets a /64.
Re:Linux gets IPv6 NAT by wmf on Monday November 21, 2011 @11:49AM (#3261711)
No, in this case CPE means whatever is attached to the cable modem.
Re:Linux gets IPv6 NAT by KonradKlause on Monday November 21, 2011 @08:17AM (#3260980)
Topology hiding.

No, please don't tell me about socks or other proxy solutions.

Re:Linux gets IPv6 NAT by viraptor on Monday November 21, 2011 @10:06AM (#3261311)
> Topology hiding.

== making VoIP deployment hard/impossible depending on your router and phone model. :(

Re:Linux gets IPv6 NAT by pilif on Monday November 21, 2011 @10:20AM (#3261364)
IMHO this is caused more by broken protocols than NAT in general. There's no reason to have the VoIP packets delivered directly instead of them being routed (on the protocol level, not IP-routing) over a central VoIP gateway.

If the singalling protocols would allow for something like 'hi - my client $foo wants to talk to your client $bar. Please direct your response to me' and the other end would then send the packets with 'this is a packet from my client $bar to your client $foo - as you told me, I'm sending it to you', then there wouldn't be an issue - aside of a very small bit of additional latency and higher complexity of the gateway software.

If these client IDs are opaque, then the network topology stays hidden, but NAT would be completely irrelevant in between.

Now, personally, I'm really looking forward to having a /64 at the end of my cable modem. I will make splendid use of it and I will highly enjoy the additional uses I get from having my machines freely accessible to the internet.

On the other hand, people got good at understanding the feature set NAT provides and, thus, at configuring NAT gateways which also don't allow incoming connections per default.

That way, if I'm just a "normal user" and I buy myself a WiFi printer, I don't have to concern myself with configuring a firewall in order to ensure that it doesn't turn into an involuntary fax machine for example.

This could of course be solved by correctly configured firewalls on these crappy blue box routers, but how many years will it take them to reach "correctly"? Will they actually be configurable enough? Or would they just drop anything with a SYN bit set? How would these crappy firewalls deal with incoming UDP? Block it unconditionally (thus breaking VoIP even more)? Add "connection" tracking? In that case, why not just NAT?

I believe it's a good thing to have NAT back. Will I use it at home? Probably not. Will my parents use it at home? Likely. Would they be affected? Likely not as we already are used to deal with NATed clients.

Re:Linux gets IPv6 NAT by lloeki on Monday November 21, 2011 @10:58AM (#3261518)
> If the singalling protocols would allow for something like 'hi - my client $foo wants to talk to your client $bar. Please direct your response to me' and the other end would then send the packets with 'this is a packet from my client $bar to your client $foo - as you told me, I'm sending it to you'

That's called routing, and routers are perfectly able to do that already, much better than some possibly whacky custom application level implementation. By your reasoning, there's no reason not to have HTTP proxies everywhere.

> I don't have to concern myself with configuring a firewall in order to ensure that it doesn't turn into an involuntary fax machine for example

This has to be the most ludicrous example I keep hearing again and again. I don't see what's different from the end-user point of view between "my gateway does NAT" vs "my gateway refuses unrelated incoming packets". Seriously, take your random Airport Extreme and it's one freaking checkbox in the IPv6 tab (which should and will, in the forecoming wide availability case, be on by default, just like current NAT).

Can we stop conflating NAT with the no-incoming filtering rule already, please? Let's look at the "hello, world" of Linux NATs example:

    /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
    /sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
    /sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
First line is NAT and protects you from nothing by itself. It only happens that usually, the WAN side can't access the LAN side because LAN is on a non-wide routable IP range so packets may simply not be routed. And guess what, second and third line which do filtering, do not require NAT, and are perfectly available features on IPv6.
Re:Linux gets IPv6 NAT by adestefan on Monday November 21, 2011 @10:38AM (#3261440)
Consumer routers have included a statefull firewall for years. The only difference for the end user will be instead of configuring port forwarding you'll modify a firewall rule. The interface would be exactly the same.
Re:Linux gets IPv6 NAT by iwwr on Monday November 21, 2011 @11:07AM (#3261550)
Protocol-wise, I always recommend IAX2 over SIP whenever possible. You can get phones, analog adapters and gateways in the iax variety, although the "serious business" (enterprise) manufacturers still sell SIP-only devices.
Re:Linux gets IPv6 NAT by viraptor on Monday November 21, 2011 @02:21PM (#3262402)
Watch out - almost no hardware got updated to randomise the callids or use the call tokens. That means if your phone can accept traffic from the internet, it's quite possible that anyone can hijack your connections, or at least ddos you.

Also it works with asterisk only, so it's not that useful in practice.

Re:Linux gets IPv6 NAT by AndrewDucker on Monday November 21, 2011 @08:50AM (#3261075)
I'm curious as to what topology is detectable from a standard IPv6 packet?
Re:Linux gets IPv6 NAT by KonradKlause on Monday November 21, 2011 @08:57AM (#3261096)
At home I have 10 computers. I want that only _one_ IPv6 address is visible to servers in the internet...
Re:Linux gets IPv6 NAT by whynotmore on Monday November 21, 2011 @09:25AM (#3261181)
Why not do the opposite and give each computer hundreds of addresses?
Re:Linux gets IPv6 NAT by KonradKlause on Monday November 21, 2011 @09:29AM (#3261192)
Because NAT is easier.

And yes, NAT is bad, ugly and from hell.

Re:Linux gets IPv6 NAT by count on Monday November 21, 2011 @12:36PM (#3261921)
How is NAT, which requires an intermediary (the NAT router/device) be configured and put in place in addition to the router, easier than IPv6 privacy addresses, where you just turn your computer on and let the router route?
Re:Linux gets IPv6 NAT by sp332 on Monday November 21, 2011 @10:16AM (#3261349)
Can't everyone just look up your IP block in a registry somewhere?
Re:Linux gets IPv6 NAT by amazingman on Tuesday November 22, 2011 @07:31AM (#3265234)
So firewall the other 9.
Re:Linux gets IPv6 NAT by nodata on Monday November 21, 2011 @08:26AM (#3260996)
Privacy.
Re:Linux gets IPv6 NAT by count on Monday November 21, 2011 @12:34PM (#3261912)
IPv6 privacy addresses are even more effective at this than NAT would be. Once the address is done being used, it goes away. You can still be tracked by your NAT'd address, as it will remain (relatively) static.