Today in our newest take on “older technology is better”: why NAT rules!

  • sep@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    18 days ago

    I felt dirty! and broke so much shit when i had to implement NAT on networks in the mid 90’s. Nowdays with ipv6 and getting rid of NAT is much more liberating. The difference is staggering!

    • you do not need NAT any longer, firewall is the security, just like on ipv4, just less obscurity.
    • you do not need dns views, to workaround NAT any more
    • you do not need hairpin NAT to workaround NAT any more
    • you do not need to renumber to resize a network. they are always /64, and the answer to how many hosts can it fit is: ALL of them!
    • many ALG’s will be unnecessary since there is not NAT.
    • vpn’s are easier, since it can be the same address both inside and outside the vpn, the firewall (or host even) enforces the encryption.
    • vpn’s are MUCH easier since you will have less rfc1918 collisions due to some other network using the rfc1918 of the vpn’s network
    • vpn’s are MUCH MUCH easier since you will have less rfc1918 collisions due to you using the rfc1918 of the vpn partner network, to 1:1 nat a previous vpn network you collided with some months ago… ARGH!!!
    • vpn are generally less required, heck i swear 95% of the time the VPN are just to workaround the NAT problem and the data is pointlessly double or triple encrypted.
    • you can make more granular firewall rules (eg the spesific host, or network of the source address, instead of the whole enterprise’s public ip) this is real tangible improved security, where any random machine in a network you do not control. do not automatically have openings into your own network.
    • firewall objects can if it is suited easily use and depend on FQDN DNS objects when allowing traffic. reducing the need of coordinating firewall object ip address changes between 15 companies.
    • firewall rules are easier, more readable, and much more predictable how they will work. All the hairpin nat, public to private nat, private to public nat for a thing that need a different public ip, 1:1 nat for a separate zone, NAT to a vpn or 50 (where 10 of them are 1:1 nat due to collisions, making you require 4 dns views of the same ip space!! ) very quickly gets messy and unreadable. this is probably the largest security benefit. just to reduce the complexity.
    • much easier to get people to use dns, since nobody wants to remember ipv6 addresses :D
    • nibbles in the ipv6 address can have meanings you assign to them, making the networks and structure both easy to remember and logically structured.
    • aggregating routes becomes very easy if you design your network that way.
    • firewall policies can become easier if you design your network that way.
    • your routing tables is leaner and easier, and of a better consistency. We have 1 large public ipv6 prefix, but 25ish ipv4 prefixes of all kinds of various sizes.
    • no need to spend $$ to buy even more ipv4 prefixes.
    • no need to have spent hundreds of $$ on a new ipv4 prefix only to be unable to use them for over a year because you need to sanitize the addresses from all the reputation filters. and constantly hound geo ip database providers to update the new country of the prefix. (i am bitter, can you tell…)
    • did i mention no need to renumber since you need to grow the /24 to /23 due to to many hosts in a network ?
    • did i mention no need to renumber 2 /24’s to /25’s to make space for that larger /23.
    • you do not even need any ipv4 addresses any more, use a public NAT64 service, for outgoing. and for incoming just use one of the many free public ipv4 to ipv6 proxies for your services online. for a homelab i really like http://v4-frontend.netiter.com/ (go support them) But most large business l networks use cloudflare, or akamai
    • since you do not need your ipv4 address space any more, you can ~~sell them for a profit $$$ ~~ return them to the RIR and give some address space to one of the thousands of companies struggling because they do not have any IPv4 : https://www.ripe.net/manage-ips-and-asns/ipv4/ipv4-waiting-list/
    • much lower latency on ipv6, since you do not go across a cloud based ipv4 to ipv6 proxy in order to reach the service ;)

    Now the greatest and best effect of ipv6 is none of the above. It is that with ipv6 we have a slim hope of reclaiming some of what made the Internet GREAT in the first place. When we all stood on equal footing. Anyone could host their own service. Now we are all vassals of the large companies that have made the common person into a CGNAT4444 using consumer mindlessly lapping up what the large company providers sees fit to provide us. with no way to even try to be a real and true part of the Internet. Fight the companies that want to make you a eyeball in their statistic, Set up your own IPv6 service on the Internet today !

      • zewm@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        17 days ago

        For me is because it’s so fucking slow. As soon as I disable ipv6 on every device it has better speeds.

        IPv6 is trash.

        • orangeboats@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          17 days ago

          Tell that to your ISP which has fucked their IPv6 deployment up. In my experience IPv6 is actually faster since it bypasses the IPv4 CGNAT.

          On busy days my IPv4 connection can get as slow as 15KB/s, now that’s trash.

          • frezik@midwest.social
            link
            fedilink
            arrow-up
            1
            ·
            17 days ago

            There’s one practical thing. Routers have had years to optimize IPv4 routing, which has to be redone for IPv6. Same with networking stacks in general.

            In theory, IPv6 should be faster by not having to do bullshit like CGNAT. There’s every reason to think it’ll match that advantage if we just make it happen.

      • Valmond@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        15 days ago

        What is localhost now again…

        Edit, remember you could use 127.0.0.1, but then it was changed to like 127.0.0.1…something…ff

        So guess I was wrong :-) thanks for the info!

    • Tja@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      18 days ago

      Con: you are now even more dependent on DNS, increasing the blast radius even more if when it breaks.

      • sep@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        17 days ago

        But DNS rarely break. The meme about it beeing DNS’s fault is more often then not just a symptom of the complexity of IPv4 NAT problem.

        If i should guesstimate i think atleast 95% of the dns issues i have ever seen, are just confusion of what dns views they are in. confusion of inside and outside nat records. And forgetting to configure the inside when doing the outside or vice verca. DNS is very robust and stable when you can get rid of that complexity.

        That beeing said, there are people that insist on obscurity beeing security (sigh) and want to keep doing dns views when using IPv6. But even then things are much easier when the result would be the same in either view.

        • Tja@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          17 days ago

          I broke DNS plenty of times in my homelab independent from NAT. In the last few months:

          • didn’t turn off DNS server in a wifi router set up as bridged access point
          • dnsmasq failing to start because I removed an interface
          • dnsmasq failing to start because the kernel/udev didn’t rename an interface on time
          • dnsmasq failing to start because hostapd error didn’t set proper interface settings
          • forgot to remove static DNS entries in /etc/hosts used for testing
          • forgot to remove DNS entries from /etc/resolve.conf after visiting a friend and working on his setup

          Yes, most of them is my dumb ass making mistakes, but in the end it’s something that constantly breaks and it helps knowing the IP addresses of my servers and routers.

          Aditionally, obscurity is a security helper. The problem is relying only on obscurity. But if I have proper firewall rules in place and strong usernames and passwords I still prefer if you don’t even know the IP addresses of my servers on top of that (in case I break some of the other security layers).

  • mlg@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    17 days ago

    Typing addresses in ipv4 is ingrained into my brain, but zero NATing with ipv6 is magical.

  • repungnant_canary@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    17 days ago

    Slightly related to the issue of remembering addresses, I think the main issue is with the fact that local nameservers are pretty much non-existent if you’re not running OpenWrt or OpnSense. Which is shameful because the local nameserver is an amazing quality of life tool.

    Also the fact that officially there are no local TLDs except for “.arpa” while browsers won’t resolve one word domains without adding http://

    And don’t get me started on TLS certificates in local networks… (although dns01 saves the day)

      • lambalicious@lemmy.sdf.orgOP
        link
        fedilink
        English
        arrow-up
        0
        ·
        16 days ago

        I’ve taken to using .here (or .aqui, “here” in Español, much harder to match outside) as alternatives until something better comes up.

        Ideally I’d use .aquí, correctly with the diacritic, but DNS doesn’t seem to support even the basics of Unicode in 2024.

        • Ephera@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          14 days ago

          Well, there is Punycode, which, if I understand correctly, is a layer before DNS, which translates a Unicode string into a DNS-compatible ASCII string.

          I don’t actually recommend using that, though. Every so often, the ugly ASCII string shows up in places, because Punycode translation isn’t implemented there. Certainly increases administration complexity.

          • lambalicious@lemmy.sdf.orgOP
            link
            fedilink
            English
            arrow-up
            1
            ·
            14 days ago

            Yeah I’ve heard about punycode. Personally, I’m well against it because it puts down non-MURRICAN English domain names as second-class citizens on the internet. If I have a website about Copiapó, a perfectly legal town, there’s no good reason why the domain name should not be copiapó.cl rather than copiap-xcwhngoingohi4oleleiyho42yt4ptg4ht4.cl, making it look “suspect” and “malware-y”.

            There were quite some complains back in the time about Firefox choosing not to “flag” internationalized names as potentially dangerous, and pretty much all those complaints that I know of likely came from English speakers who simply can’t understand other countries in the world even can have different alphabets.

            • Ephera@lemmy.ml
              link
              fedilink
              arrow-up
              1
              ·
              14 days ago

              I mean, there is some legitimate concerns. For example, in theory, someone could register a domain “αpple.com” and use that to send phishing mails. That “α” is an alpha. The more alphabets and letter variants you allow, the more lookalikes there will be.

              But yeah, in practice, domain registrars check that you’re not registering such a lookalike domain and then that’s not really a problem, as far as I’m aware.

  • DefederateLemmyMl@feddit.nl
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    17 days ago

    IPv6 = second system effect. It’s way too complicated for what was needed and this complexity hinders its adoption. We don’t need 100 ip addresses for every atom on the earth’s surface and we never will.

    They should have just added an octet to IPv4 and be done with it.

    • eyeon@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      17 days ago

      it’s not about using all 100 IP addresses for every atom

      it’s about having large enough ranges to allocate them in ways that make sense instead of arbitrarily allocating them by availability

    • orangeboats@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      17 days ago

      Every time there’s a “just add an extra octet” argument, I feel some people are completely clueless about how hardware works.

      Most hardware comes with 32-bit or 64-bit registers. (Recall that IPv6 came out just a year before the Nintendo 64.) By adding only an extra octet, thus having 40 bits for addressing, you are wasting 24 bits of a 64-bit register. Or wasting 24 bits of a 32-bit register pair. Either way, this is inefficient.

      And there’s also the fact that the modern internet is actually reaching the upper limits of a hypothetical 64-bit IPv5: https://lemmy.world/comment/10727792. Do we want to spend yet another two decades just to transition to a newer protocol?

  • mholiv@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    18 days ago

    I think it’s worth taking the time to learn IPv6 property. If you have a good understanding of IPv4 it shouldn’t take you more than an afternoon.

    Eliminating NAT and just using firewall rules (ie what NAT does behind your back) is incredibly freeing.

    I don’t get people complaining about typing out IPs. I like to give all of my clients full FQDNs but you don’t have to. Just using mDNS would be enough to avoid typing a bunch of numbers.

    • FrostyCaveman@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      18 days ago

      Maybe I have Stockholm Syndrome, but I like NAT. It’s like, due to the flaws of IPv4 we basically accidentally get subnets segmented off, no listening ports, have to explicitly configure port forwarding to be able to listen for connections, which kinda implies you know what you’re doing (ssshh don’t talk about UPnP). Accidental security of a default deny policy even without any firewalls configured. Haha. I’m still getting into this stuff though, please feel free to enlighten me