News for hackers. Stuff that matters.
Re:Hello IPv6: a minimal tutorial for IPv4 users by justsomehnguy on Saturday January 27, 2024 @07:14PM (#39161204)
> NAT provides security as a side-effect.

sigh

NAT provides a false sense of security as a side-effect.

There is nothing in NAT what couldn't be done with DENY rule in the firewall.

Re:Hello IPv6: a minimal tutorial for IPv4 users by TheLoafOfBread on Saturday January 27, 2024 @07:21PM (#39161246)
Misconfigured NAT is not working on either side.

Misconfigured firewall is a gaping hole into the local network.

Re:Hello IPv6: a minimal tutorial for IPv4 users by yesco on Saturday January 27, 2024 @07:41PM (#39161371)
A misconfigured firewall is a gaping hole in your network regardless of whether NAT is involved. This means someone could brute force access into the configuration interface of your router and configure your network however they like.

NAT security is a dangerous illusion that people just can't seem to stop falling for.

Re:Hello IPv6: a minimal tutorial for IPv4 users by drtgh on Saturday January 27, 2024 @08:34PM (#39161686)
The anonymous IPV4 network behind a NAT, which by default is inaccessible from the Internet and which, if it fails, just leaves the local network isolated, with IPv6 turns it a part of internet, accessible by default & design from internet with unique IPv6 for each computer and device, with the firewall as the only one separation.

The dangerous illusion is to think this is a coincidence.

Re:Hello IPv6: a minimal tutorial for IPv4 users by yesco on Saturday January 27, 2024 @10:31PM (#39162286)
> The anonymous IPV4 network behind a NAT, which by default is inaccessible from the Internet and which, if it fails, just leaves the local network isolated, with IPv6 turns it a part of internet, accessible by default

False, the default behavior is the same as IPv4/NAT. While the address scheme is technically "global", the firewall will still by default be blocking inbound connections to those addresses.

It is not unlike a random uuid or even a mac address in that the address is simply globally unique in nature, but not necessarily accessible unless you deliberately configure it to be, not unlike how one deliberately configures port forwarding in a local NAT based network firewall.

With IPv6 your ISP is giving your router an address "prefix" instead of just a single address as they usually do. The process of generating these addresses is therefore entirely local and anonymous from everything else on the Internet, obviously excluding hosts that are deliberately connected to who can then see the source address, but even in these cases your global address changes constantly so remote hosts still can't figure out your internal network topology. The reason these addresses are globally unique despite this is thanks to the ISP provided "prefix", which is essentially just a unique namespace.

> With the firewall as the only one separation.

As is the case with a NAT based network.

Re:Hello IPv6: a minimal tutorial for IPv4 users by drtgh on Saturday January 27, 2024 @11:59PM (#39162724)
>False, the default behavior is the same as IPv4/NAT.

The default behavior it is not the same as IPv4 with NAT, where the internet and local are different networks.

>It is not unlike a random uuid or even a mac address in that the address is simply globally unique in nature, but not necessarily accessible unless you deliberately configure it to be, not unlike how one deliberately configures port forwarding in a local NAT based network firewall.

The prefix the ISP gives to the router for to assign the IPv6 addresses to computers and devices it is the prefix of the unique uuid each one will get assigned. An unique IPv6 address is assigned to each one of these computers and devices, and internet record each access of each one of them individually.

If the firewall fails or if it's shut down, all get exposed to internet, because IPv6 it is designed to make every computer and device part of the internet network by default.

Re:Hello IPv6: a minimal tutorial for IPv4 users by LegionMammal978 on Saturday January 27, 2024 @08:09PM (#39161520)
Are you saying that every firewall misconfiguration that exposes any one host to the public Internet necessarily exposes control over the router configuration to the public Internet? I don't see how that follows.
Re:Hello IPv6: a minimal tutorial for IPv4 users by yesco on Saturday January 27, 2024 @09:02PM (#39161815)
No, I'm saying the firewall is what prevents access to the router's configuration interface regardless of whether you are using NAT. If you misconfigured it so that it was exposed and people could now break in, then all they would need to do after that is set up port forwarding to whatever internal host they want.

If you mean to imply that what I'm saying here is ridiculous because a "firewall misconfiguration that exposes any one (non-router) host to the public Internet" is only possible with a IPv6 or a NAT-less IPv4 network then you would be wrong (unless you were just being pedantic that I excluded such an example). A misconfigured firewall that exposes an internal host to the Internet would just look slightly different with NAT, since hosts are usually exposed via the firewall's port forwarding rules instead of the full featured allow/deny rules. There are technically going to be more firewall configuration options in NAT-less networks, but the risk of a misconfiguration accidentally exposing a host is not going to be any greater here.

If anything port forwarding actually encourages "accidental" exposure. They are usually kept in a separate interface from the other firewall rules, which indirectly encourages configurations that do blanket exposure to the Internet. Ideally internal networks should be configured to only allow inbound connections to specific host:ports from trusted external IPs/IP-ranges, but NAT makes this more complicated to do, so people get complacent with just exposing all inbound connections to specific host:ports because that is what port forwarding is usually going to default to absent of any other configuration.

Re:Hello IPv6: a minimal tutorial for IPv4 users by LegionMammal978 on Saturday January 27, 2024 @10:50PM (#39162382)
> No, I'm saying the firewall is what prevents access to the router's configuration interface regardless of whether you are using NAT.

I still don't understand. Even if we assume that the configuration interface has no internal security (e.g., a strong password), how would a router with a NAT but with a totally busted firewall allow access to its configuration interface from arbitrary external hosts (short of having a forwarding rule for itself, which I suspect wouldn't even work on many routers)? What would such an inbound connection from an adversary look like?

> If anything port forwarding actually encourages "accidental" exposure. They are usually kept in a separate interface from the other firewall rules, which indirectly encourages configurations that do blanket exposure to the Internet.

It would seem to me like host-specific IPv6 firewall rules have their own challenges. Under IPv4 NATs, special internal hosts (that need their own rules) can be trivially assigned persistent labels through DHCP. With IPv6, if each host chooses its own address and rotates it regularly, then how are hosts persistently identified in the firewall rules? By MAC address? Or are there other systems for this?

Re:Hello IPv6: a minimal tutorial for IPv4 users by burnerthrow008 on Saturday January 27, 2024 @09:40PM (#39162038)
> If you misconfigured it so that it was exposed and people could now break in, then all they would need to do after that is set up port forwarding to whatever internal host they want.

Why are these objections always "What if I configure my IPv6 network in worst way possible?"

Your router's configuration interface should be hosted on either a ULA or a link-local address, neither of which are routable. Security isn't the only reason you want to do that.

If you host the config interface on a globally-routable address, that address will change every time your ISP delegates your network a new prefix (which happens about as often as you would get a new external IPv4 address via DHCP). A router is the one of the few things on your network you should be able to access even without working DNS, so why do you want the config interface to be on an address than can change unexpectedly?

ULA and link-local addresses can be static: The network prefix will be static.

In IPv4, this is like asking "But what if I host my router's interface on the public assigned-by-DHCP IP?" My response would be "Why the hell would you host the config interface on an address that can change at any time?"

Re:Hello IPv6: a minimal tutorial for IPv4 users by yesco on Saturday January 27, 2024 @10:03PM (#39162151)
I've given up explaining things this way, it's too jargon heavy and skips over the fact that most people objecting to this are fundamentally misunderstanding critical details about how their networks operate. I suspect there is a degree of self-awareness regarding this which is why the concern can often be reduced down to: "I'm scared of fucking up my configuration, I have confidence in the levers I'm familiar with, but fear the levers I don't understand, so I hate them"

My hope is that by walking through it with simplified examples, this fear is mitigated.

Re:Hello IPv6: a minimal tutorial for IPv4 users by drtgh on Saturday January 27, 2024 @07:46PM (#39161398)
In addition, the routers installed by ISPs are rarely updated and these firewalls will be very vulnerable. Until I get a router with NAT for IPv6, I'm not going to do anything with IPv6, I will even to change ISP if necessary.
Re:Hello IPv6: a minimal tutorial for IPv4 users by jiggawatts on Saturday January 27, 2024 @10:39PM (#39162325)
You trust them with complex packet processing, but not with simple packet blocking!?
Re:Hello IPv6: a minimal tutorial for IPv4 users by drtgh on Sunday January 28, 2024 @12:08AM (#39162779)
What simple packets, the ones than can be easily charged without the interference of NAT!?
Re:Hello IPv6: a minimal tutorial for IPv4 users by cyberax on Saturday January 27, 2024 @07:26PM (#39161279)
> NAT provides a false sense of security as a side-effect.

Why?

> There is nothing in NAT what couldn't be done with DENY rule in the firewall.

DENY doesn't provide you stateful tracking. I.e. you want to let traffic between two hosts flow, but only if an internal host on your network initiated it.

And once you do that, you basically have 80% of NAT.

Re:Hello IPv6: a minimal tutorial for IPv4 users by yesco on Saturday January 27, 2024 @07:36PM (#39161340)
If you just want an address that isn't routable on the Internet then why don't you just use a local/wan ipv6 address? You can even have a local/wan address in addition to an Internet routable address at the same time, all without a hacky network address translation layer in your router.

Alternatively, if you mean local to external host connections, why would an inbound deny rule not work here?

Re:Hello IPv6: a minimal tutorial for IPv4 users by LegionMammal978 on Saturday January 27, 2024 @08:14PM (#39161564)
> You can even have a local/wan address in addition to an Internet routable address at the same time, all without a hacky network address translation layer in your router.

Suppose that a host wants to open outbound connections to other hosts on the same network, as well as across the Internet, without regard to which kind of destination it is. By what mechanism does the host decide which source address to use? And how portable is this mechanism across different systems?

Re:Hello IPv6: a minimal tutorial for IPv4 users by yesco on Saturday January 27, 2024 @09:38PM (#39162031)
Let's suppose the following network configuration:

Host A

  Address1 "Global:Address:A"
  
  Address2 "Local:Address:A"
Host B

  Address1 "Global:Address:B"
  
  Address2 "Local:Address:B"
If you are Host A and want to connect to Host B, while simultaneously ensuring that your connection to host B is done over your local network; Then you would initiate this connection using "Local:Address:B"; and since it's prefix ("Local") matches the prefix of one of your addresses:"Local:Address:A", then your OS would automatically use that as it's source address.

Now if Host A connected to Host B via it's global address "Global:Address:B", then it would also work, but then Host A's connection would look like any other Internet address (and would still technically be routed over the internal network since it's the shortest path).

The router/firewall, which would sit in front of these two hosts, would still see this all as local traffic though, and in the vast majority of cases be configured by default to block all incoming traffic from outside the network. This means unless the firewall is configured to allow some kind of external connection into Host B, and Host B does not initiate the connection itself, then it would never actually see any global addresses from anything other than Host A.

> And how portable is this mechanism across different systems?

It's all about what address you use, so I could say portability would be limited to IPv6 support, but broadly speaking everything I've described here also applies to NAT-less IPv4 too, which is how most cloud VM networks are usually configured. Having both Local and Global addresses can be convenient in cases where you have multiple environments (ie: dev,stage,prod), since you can reuse most configurations referenceing internal system IP addresses.

Re:Hello IPv6: a minimal tutorial for IPv4 users by LegionMammal978 on Saturday January 27, 2024 @11:06PM (#39162470)
> Then you would initiate this connection using "Local:Address:B"; and since it's prefix ("Local") matches the prefix of one of your addresses:"Local:Address:A", then your OS would automatically use that as it's source address.

This is the step that I'm particularly concerned about. Suppose that I have a Host B on my network, and I want to totally ensure that it has nothing to do with the global Internet, so I assign it only a local address and no global address. Then, I set up a local DNS service in my network, so that any host can ask for "Host.B" and get "Local:Address:B" back.

The problem is, will every kind of Host A, no matter what kind of embedded or IoT or corporate nonsense it's running, be able to properly manage both its local and global source addresses, and select its local address when it wants to connect to "Host.B"? This is a lot more to expect from a host than with IPv4 NAT, where Host A just uses its local address, and the router transparently handles the differences between local and global connections.

Re:Hello IPv6: a minimal tutorial for IPv4 users by yesco on Sunday January 28, 2024 @03:08AM (#39163475)
With even just IPv4 you can have multiple IP addresses assigned to one NIC, the one used will be determined based on your destination. This is a part of the protocol, having a local address and a global address was expected from the very begining with IPv4 (well more like having multiple IP addresses was expected), NAT was made as a bandaid to fix the fact that there weren't enough addresses to support this. Pretty much any VM you make in the cloud will actually follow this traditional model by default with each VM having it's own local and global IPv4 addresses at the same time. It's nothing special, you can expect every NIC to support this, this is basic stuff, you can expect it to work on everything every time.

Fundamentally all NAT does is simulate this kind of traditional network. It's an attempt to replicate this behavior by having all hosts "share" a global IP address that the router would then dynamically redirect back and forth based on which local host initiated the connection.

However the packets must physically pass through your firewall to get into your network. The IP addresses are simply an identifier to put onto the envelope, a firewall does not give a fuck about what the envelope says if a remote host attempts to initiate an inbound connection and this is forbidden (which it always is by default). Before a packet from the Internet even gets an opportunity to even get to the NAT part it is trashed. The firewall is the security guard at the door checking your badge, after that you go to the reception who "routes" you to the correct host. If an address isn't routable, which may be the case in a NAT network, then it's no big deal since you can just threaten the receptionist to tell you where to go

All NAT routers with Internet access will have both a local address and a global address natively, that's how it is even capable of sharing it's Global addresses in the first place, the firewall is what protects it, not NAT. If something can magically get past your firewall then that implies they have full control of your router now and can route packets wherever they like, remember this is hypothetical because breaking past a firewall is already a complete system failure, the boat has already sunk. At the end of the day it's all the same firmware, why would you trust the NAT part more than the Firewall part? It's literally just semantics.

> This is a lot more to expect from a host than with IPv4 NAT, where Host A just uses its local address, and the router transparently handles the differences between local and global connections.

I'm reiterating here but everything I've described so far is in relation to IPv4, all IPv6 introduces to the equation is: more addresses so you don't need NAT, a clever way to do dhcp on a local host without router intervention: SLAAC (routers can still advertise what to use as prefixes to these addresses). It also fuses together some of IPv4's extensions into one cohesive protocol that's simpler to understand. It's not nearly as radical as you may believe, it simply brings things back to how they were when IPv4 addresses were abundant and simplifies your firewall since you can easily configure which traffic can go to which host without involving weird port forwarding shenanigans.

Attachment to NAT for security is fundamentally a misunderstanding of what role it is serving, an assumption that it has more responsibilities than it actually does. It is not DHCP, it is not a Firewall. If you want to expose a local host to the Internet with NAT you configure the firewall to "forward the port" so inbound connections get redirected to your designated local host. If you want to expose a NAT-less local host to the Internet, you go to the firewall configure it to allow inbound connections with destinations set to your local host's global IP address and it's port.

FYI if you want you can have a static global address only used for inbound connections in addition to randomized globals for outbound connections. Though generally if you are setting up a server anonymous outbound connections are kinda pointless imo.

Re:Hello IPv6: a minimal tutorial for IPv4 users by LegionMammal978 on Sunday January 28, 2024 @10:23PM (#39172370)
> It's nothing special, you can expect every NIC to support this, this is basic stuff, you can expect it to work on everything every time.

Even if every NIC supports it, how do I know that every OS supports it? Every system I've ever used has only needed a single address, so the multiple-address cases would seem to be a small minority (and mostly in networks with homogeneous systems), and not something I'd expect to be thoroughly tested on every random IoT device.

> If an address isn't routable, which may be the case in a NAT network, then it's no big deal since you can just threaten the receptionist to tell you where to go

What do you mean? If a host doesn't have its incoming connections forwarded from the router's global address, then how can it be accessed from the outside?

> If something can magically get past your firewall then that implies they have full control of your router now and can route packets wherever they like

You still haven't explained why this is the case. How does a firewall that exposes the router's address necessarily allow arbitrary control over the router? After all, I can access the router on my WAN all I want through its local address, and yet I'm still unable to reconfigure it.

> I'm reiterating here but everything I've described so far is in relation to IPv4, all IPv6 introduces to the equation is: more addresses so you don't need NAT, a clever way to do dhcp on a local host without router intervention

My big concern here is that I don't necessarily want every local host to be responsible for managing this, since I trust the router to have correct behavior far more than I trust every arbitrary host to have correct behavior.

Re:Hello IPv6: a minimal tutorial for IPv4 users by Dagger2 on Sunday January 28, 2024 @10:39AM (#39166735)
You don't actually need to use Local:Address:A as a source to connect to Local:Address:B, you can connect from Global:Address:A.

To make it more specific: if you advertise both 2001:db8:1::/64 and fd00::/64 as on-link on your network, a host can connect from 2001:db8:1::a to fd00::b, and fd00::b can reply to 2001:db8::a. Because both ranges are on-link, all communication is on-link and is never sent to the router. (This is just the normal behavior for on-link ranges.)

Re:Hello IPv6: a minimal tutorial for IPv4 users by LegionMammal978 on Sunday January 28, 2024 @10:41PM (#39172455)
What if the two hosts have no link-level connection, and the router is the only thing connecting them? Would I need to have a fiddly rule in my router's firewall allowing connections to and from Host B only if the other host has either the local range or the proper global range?
Re:Hello IPv6: a minimal tutorial for IPv4 users by Dagger2 on Monday January 29, 2024 @02:23AM (#39173675)
Do you mean, say, one device that's on Ethernet and one that's on WiFi? Most people have their Ethernet and WiFi setups bridged so they count as the same link.

If you actually mean two separate networks, where traffic has to be routed via the router... obviously there's a lot of ways of setting up firewall rules, and it depends on exactly what you want to do, but the simplest approach is to say "deny new connections coming in via the WAN interface". This will allow new connections going out the WAN interface, and also allow all connections between the two local networks in both directions, with no need to specify any IP ranges in the firewall at all.

Re:Hello IPv6: a minimal tutorial for IPv4 users by cyberax on Saturday January 27, 2024 @10:31PM (#39162287)
> If you just want an address that isn't routable on the Internet then why don't you just use a local/wan ipv6 address?

No. I want an address that can connect to the hosts on the Internet, but I don't want random hosts on the Internet to connect to it.

Basically, what NAT does is pretty much the perfect compromise for small-scale home/office security.

Re:Hello IPv6: a minimal tutorial for IPv4 users by yesco on Saturday January 27, 2024 @11:02PM (#39162445)
> No. I want an address that can connect to the hosts on the Internet, but I don't want random hosts on the Internet to connect to it.

Gotcha glad we are on the same page now, so you do want the functionality of an inbound deny all rule, which is configured by default on all consumer routers, regardless of if they are IPv6 or even NAT/IPv4.

Why in the world, would you ever, want to expose all your local hosts to the Internet by default after all? That would be insanity.

It also has nothing to do with IPv6.

Re:Hello IPv6: a minimal tutorial for IPv4 users by cyberax on Sunday January 28, 2024 @08:23AM (#39165484)
You can have simple DENY for inbound TCP connections, because you can simply block incoming SYN packets. But inbound stateless DENY can't deal with UDP, as there is no connection.

So your options are either to prohibit UDP (goodbye QUIC) or to have stateful tracking.

Re:Hello IPv6: a minimal tutorial for IPv4 users by tomjen3 on Saturday January 27, 2024 @11:31PM (#39162602)
Accepting packages that are part of an established connection are a standard option form IP table configurations.

And if you want to do something like host a minecraft server on your computer that you can then let your friends access (and only your friends), you need a firewall config anyway.

Re:Hello IPv6: a minimal tutorial for IPv4 users by justsomehnguy on Sunday January 28, 2024 @04:23AM (#39163890)
I responded to a similar comment there: https://news.ycombinator.com/item?id=39163623

> DENY doesn't provide you stateful tracking.

Yes, but I wrote that for the usual "but NAT doesn't let attackers get in my network!!1" in mind. Not the first time here: https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...

sigh I probably should just make a blog post on it or something and just point people there.

Re:Hello IPv6: a minimal tutorial for IPv4 users by cyberax on Sunday January 28, 2024 @09:00AM (#39165806)
The thing is, NOTHING in your post disputes that NAT provides very real, simple, and robust security for local networks. With NAT you simply can NOT make unsolicited connections to internal hosts.

It's not an illusion, it's actual security. Is it completely foolproof? No. But it definitely makes it easier to use, e.g. esp8266-based devices without worrying that they'd be knocked offline by an automated script that sends a couple megabits of traffic their way.

And to do the same on IPv6 you need 80% of NAT, in particular you need stateful connection tracking.

Re:Hello IPv6: a minimal tutorial for IPv4 users by Dagger2 on Sunday January 28, 2024 @11:09AM (#39166987)
You simply can. NAT doesn't give any security whatsoever. Here's an unsolicited connection to an internal host over a router that's doing NAT:

  (192.168.0.101)$ echo "Hello from inside" | nc -vlp5000
  Connection from [203.0.113.1] port 5000 [tcp/*] accepted (family 2, sport 36596)

  (203.0.113.1)$ nc 192.168.0.101 5000
  Hello from inside
And here's the 3-way handshake captured on the router:

  wan0  In  IP 203.0.113.1.36854 > 192.168.0.101.5000: Flags [S]
  lan0  Out IP 203.0.113.1.36854 > 192.168.0.101.5000: Flags [S]
  lan0  In  IP 192.168.0.101.5000 > 203.0.113.1.36854: Flags [S.]
  wan0  Out IP 192.168.0.101.5000 > 203.0.113.1.36854: Flags [S.]
  wan0  In  IP 203.0.113.1.36854 > 192.168.0.101.5000: Flags [.]
  lan0  Out IP 203.0.113.1.36854 > 192.168.0.101.5000: Flags [.]
See? It works just fine. Here's the other direction, just in case you think I wasn't NATing:

  lan0  In  IP 192.168.0.101.44682 > 203.0.113.1.5000: Flags [S]
  wan0  Out IP 203.0.113.58.44682 > 203.0.113.1.5000: Flags [S]
(If you want to see any aspect of the config, just ask. Give me commands to run if you want.)
Re:Hello IPv6: a minimal tutorial for IPv4 users by cyberax on Sunday January 28, 2024 @12:34PM (#39167869)
I can also deliberately misconfigure the router, connect directly to it's WAN port, and then pretend that it somehow validated my nonsense statement.

This works ONLY if you control the ISP infrastructure, and the router is allowing inbound traffic to LAN. Mikrotik by default doesn't.

Re:Hello IPv6: a minimal tutorial for IPv4 users by Dagger2 on Sunday January 28, 2024 @01:22PM (#39168297)
The fact that it works at all disproves your "you can't do it" claim.

I didn't misconfigure the router here. Please ask for whatever config info would convince you of that. It's true that most router devices you buy (presumably including Mikrotik) do block inbound connections by default, but they do it with a firewall, not with NAT. The reason they need the firewall is because NAT doesn't do it.

Re:Hello IPv6: a minimal tutorial for IPv4 users by cyberax on Sunday January 28, 2024 @03:00PM (#39169267)
Yes, it is correct. You can't do it in practice, because it requires you to control the ISP.

This automatically makes it a non-issue for pretty much all home and small office networks. Meanwhile, the DEFAULT state for IPv6 is being open to the world.

> I didn't misconfigure the router here. Please ask for whatever config info would convince you of that.

OK. How can I ping your address? It should be easy, right? I'll even give you my IP: 208.52.76.162 , what do I need to set up to be able to ping all your internal hosts?

Let's make that experiment.

Re:Hello IPv6: a minimal tutorial for IPv4 users by greyface- on Monday January 29, 2024 @12:22AM (#39172966)
Hi, Condointernet/WaveG/Astound user. I've used their network before, and from experience, they put you on the same L2 segment as your neighbors. There's ARP/DHCP/etc filtering in place on the switch to prevent most kinds of shenanigans, but your neighbors can still send packets with a RFC1918 dst IP to your Ethernet address.

To ping your internal hosts, I'd need to gain access to your building or one sharing the same L2 segment ("dfsea"?), then configure a static route for 10/8 / 192.168/16 / etc pointing at you. I would not need any control over the ISP.

Re:Hello IPv6: a minimal tutorial for IPv4 users by cyberax on Monday January 29, 2024 @01:25PM (#39180131)
I'm on a business line, and the L2 Ethernet segment consists of 1 device, their router.

And most of Wave users (or any broadband users in the US, for that matter) use DOCSIS, which does not have a shared L2.

Re:Hello IPv6: a minimal tutorial for IPv4 users by greyface- on Monday January 29, 2024 @11:45PM (#39186485)
That's fantastic for you, and for DOCSIS users (setting aside DOCSIS' other pain points), but your neighbors on residential Ethernet-based plans do not enjoy the supposed security benefits of NAT that you claimed upthread.
Re:Hello IPv6: a minimal tutorial for IPv4 users by Dagger2 on Monday January 29, 2024 @02:02AM (#39173556)
You can't do it in practice because everybody has firewalls, and also widespread use of RFC1918 in v4 makes it hard to even send the right packets to the right place. I wasn't arguing that; my point was just that NAT won't stop any inbound connection, and if your inbound connections are being stopped by something... then the something isn't NAT.

> OK. How can I ping your address? It should be easy, right? I'll even give you my IP: 208.52.76.162 , what do I need to set up to be able to ping all your internal hosts?

> Let's make that experiment.

Sure. Since I'm using RFC1918 on the inside you'll need to be on my immediate upstream segment to test this, so I set up a gre tunnel for you. If you're on Linux you can run something like this (otherwise I'll leave it up to you to map the tunnel setup to whatever you're using):

  $ ip netns add temp
  $ ip link add gretap type gretap local 208.52.76.162 remote 151.115.75.246
  $ ip link set netns temp gretap
  $ ip netns exec temp "$SHELL"
  (inside netns)$ ip link set up dev gretap
  (inside netns)$ ip addr add 203.0.113.150/24 dev gretap
That will put you on my upstream segment, outside of my NATed network, using 203.0.113.150. Then just do this:

  (inside netns)$ ip route add 192.168.0.0/24 via 203.0.113.58
  (inside netns)$ ping 192.168.0.101
Re:Hello IPv6: a minimal tutorial for IPv4 users by cyberax on Monday January 29, 2024 @01:22PM (#39180055)
> I wasn't arguing that; my point was just that NAT won't stop any inbound connection, and if your inbound connections are being stopped by something... then the something isn't NAT.

NAT _will_ stop inbound connections in practice, unless you control the ISP. So in practice NAT provides more than enough security for typical SOHO users.

> Sure. Since I'm using RFC1918 on the inside you'll need to be on my immediate upstream segment to test this

Exactly. Which means that you need (in practice) to control the ISP for this attack to work.

Re:Hello IPv6: a minimal tutorial for IPv4 users by Dagger2 on Monday January 29, 2024 @03:21PM (#39181938)
No, it won't. All that's needed is an inbound route to your router, and NAT can't prevent that route from existing. It doesn't matter if you have ISP control or not.

I'm not seeing any gre packets from you. Are you having trouble getting the tunnel working?

Re:Hello IPv6: a minimal tutorial for IPv4 users by Dagger2 on Saturday February 03, 2024 @10:30AM (#39241214)
...are you going to do this experiment or not? I've got the whole setup just waiting for you.
Re:Hello IPv6: a minimal tutorial for IPv4 users by justsomehnguy on Sunday January 28, 2024 @12:50PM (#39168013)
Lol, Mikrotik by default has an empty firewall ruleset with policy ACCEPT.
Re:Hello IPv6: a minimal tutorial for IPv4 users by cyberax on Sunday January 28, 2024 @04:20PM (#39169931)
It also doesn't add routes between the outer and inner networks.
Re:Hello IPv6: a minimal tutorial for IPv4 users by Dagger2 on Monday January 29, 2024 @12:29PM (#39179180)
That's not quite how routes work, but... of course it does. Outbound connections wouldn't work otherwise.
Re:Hello IPv6: a minimal tutorial for IPv4 users by JackSlateur on Sunday January 28, 2024 @06:19AM (#39164571)
NAT breaks the end-to-end IP communication

To let things work, we added ALG (application level gateway), which are code used to remotely allow flows

Look at them, a whole universe of issue lies there

Re:Hello IPv6: a minimal tutorial for IPv4 users by cyberax on Sunday January 28, 2024 @12:30PM (#39167822)
ALGs are not used or needed for most protocols anymore, they are actively harmful in most cases.

The current state of the art is to use hole punching and STUN.

Re:Hello IPv6: a minimal tutorial for IPv4 users by JackSlateur on Sunday January 28, 2024 @01:06PM (#39168133)
Being used ? Being needed ? What is important is that they are here and enabled and ready to be exploited
Re:Hello IPv6: a minimal tutorial for IPv4 users by cyberax on Sunday January 28, 2024 @03:03PM (#39169285)
ALGs (for SIP and FTP) are not enabled on OpenWRT by default. And I don't think any other ALGs had ever been widely used in practice.
Re:Hello IPv6: a minimal tutorial for IPv4 users by chrisandchris on Sunday January 28, 2024 @02:39AM (#39163343)
> There is nothing in NAT what couldn't be done with DENY rule in the firewall.

I don't get the "false-security" issue with NAT.

I still need NAT if I can't allocate 1 IP per host, so if I create a NAT rule, why would I also need a firewall rule covering the same port (assuming default is DENY)?

Where does the false-security come into play?

Re:Hello IPv6: a minimal tutorial for IPv4 users by justsomehnguy on Sunday January 28, 2024 @03:38AM (#39163623)
You are talking about outbound NAT.

"NAT is a security boundary" sits on using RFC1918 addresses and "nobody can enter my network because there is no DNAT rules for it!".

If you know how the routing actually works on Ethernet networks then it should be pretty obviously, but if not: there is no magic there.

If you know what the packet is addressed to some network not in your routing list, then you just throw it the default router with dstaddr of the recipient and MAC address of the default gateway. There is no security or anything.

And the same applies to the traffic you receive on the external interface. Anything what would be received on the external interface would be forwarded to your local networks if dstaddr of the packet is in your local network range.

And there is two ways to throw some packets with dstaddr in RFC1918 to your external interface:

a) be on the wire of your external interface - you can't forward those packets over Internet, obviously

b) have DNAT what would rewrite the IP of your external interface in dstaddr to some internal IP

So having internal addressing according to RFC1918 on the LAN and therefore using NAT to access anything else - doesn't make your network secure.

Usually this is not a problem, but if you are thinking what NAT do makes your network secure then you have two problems: possibly an unsecure network and feeling what your network is secure.

> why would I also need a firewall rule covering the same port (assuming default is DENY)?

Assuming. There are people out there who can't even configure their firewall properly: https://news.ycombinator.com/item?id=38879470

EDIT: Oh, how quaint, just downvoting without responding. Remember, downvotes are not for your opinion on the comment.

But while we are at it, two more options on having an external packet traverse to your local network:

c) have a host on the LAN initiate a connection to the Internet, which opens up a port on the external interface of the router. Sure, in 99.9999% you can't use that, because the statefull firewall would discard the incoming packets not from the host which a client communicates... Until the attacker is that host in the first place, ie malware or even a deliberate operation

d) UPnP. 'Nuff said.

Re:Hello IPv6: a minimal tutorial for IPv4 users by chrisandchris on Monday January 29, 2024 @12:33PM (#39179231)
I didn't vote at your comment at all, so don't blame me. However you'll get an upvote from me now.

I agree about (some to most) of your writing and it was very informative (and lengthy!) but I didn't find the time to write something back which would honor your response enough.

Re:Hello IPv6: a minimal tutorial for IPv4 users by justsomehnguy on Monday January 29, 2024 @03:16PM (#39181869)
Oh, sorry, that definitely looks like it was directed personally at you.

Thank you for providing a feedback, because it's way more valuable than some virtual updoots. But thanks for the virtual updoot too!