• 0 Posts
  • 20 Comments
Joined 1 year ago
cake
Cake day: June 17th, 2023

help-circle
  • Overall everyone will use less data when there’s a data cap, I found.

    My ISP implemented data caps back then too (thankfully it’s all removed now, but 60GB was really bonkers!) and I just find it fascinating how much traffic I generate nowadays, when I don’t have to care how much data I have left this month.

    Anyways, data caps shouldn’t be relevant anymore in 2023 when absolutely everything can handle gigabits and more. It’s interesting how American ISPs still implement them.


  • I sorta understand why data caps were implemented in the past. Some people hosted servers on their home connection, and their total internet traffic in a week would far exceed that of a normal user’s. Data caps were meant to force people to be conservative on their internet usage so this would not happen.

    But come on now, it’s 2023. If your internet infrastructure could not handle that amount of traffic, you are a laughing stock of ISPs.





  • Right. Packets still have to go through your router, assuming that your router has firewall turned on, it goes like this:

    1. Your router receives a packet.

    2. It checks whether the packet is “expected” (a “related” packet) - by using connection tracking.

      For example, if ComputerA had sent something to ServerX before, and now the packet received by router says “from ServerX to ComputerA”, then the packet is let through - surely, this packet is just a reply to ComputerA’s previous requests.

    3. If step 2 fails - we know this is a new incoming packet. Possibly it comes from an attacker, which we don’t want. And so the router checks whether there is a rule that allows such a packet to go through (the assumption is that since you are explicitly allowing it, you know how to secure yourself.)

      If I have setup a firewall rule that says “allow packets if their destination is ComputerB, TCP port 25565”, and the received packet matches this description, the router lets it through.

    4. Finally, the packets that the router accepts from the previous steps are forwarded to the relevant LAN hosts.


  • IP addressing is just a way to give a globally unique number to each device. It’s just a number.

    And there wasn’t a real public/private distinction when the Internet was still in its infancy. Printers were indeed given “public” addresses because people needed a number for it.

    If you don’t want your printer to be reachable by the public Internet, use a firewall to block outside connections. If you can use NAT, you certainly can use a firewall. Heck, they are almost the same thing if you have been using the Linux kernel (iptables/nftables handle firewalling and masquerading with the same tool!)

    Routability is not the same as reachability. With NAT transversal you can reach my “private” hosts all the same, although you can’t route to me because I don’t have a public address.


  • Port forwarding is exclusively a NAT phenomenon.

    In IPv6 every device should in theory have a public address - just like how every computer had a public IPv4 address back in the 1980s ~ 1990s.

    However, most sensible routers will have a firewall setup by default that blocks all incoming connections for security reasons. You still need to add firewall rules.



  • Living in the APNIC region, we are kinda notorious for being the first region to run out of IPv4 addresses.

    The top 3 mobile ISPs in my country here have been doing CGNAT since at least 2014. Cable ISPs are limiting public IPv4 according to plans since at least 2017, i.e. if the download speed of your plan is below 200Mbps , you get CGNATed.

    We are severely out of IPv4 addresses.


  • orangeboats@lemmy.worldtoSelfhosted@lemmy.worldIs moving to IPv6 worth it?
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    1
    ·
    edit-2
    1 year ago

    It’s not necessary to firewall every device. Just like how your router can handle NAT, it should be able to handle stateful firewall too.

    Mine blocks all incoming connections by default. I can add (IP, port range) entries to the whitelist if I need to host a service, it’s not really different to NAT port forwarding rules.





  • IPv4 version: Think of your public IP:Port as the office building, your internal IP:Port as the floor number, and reverse proxy as the reception on that floor.

    (Your public IP:Port is routed to your internal IP:Port by the NAT on your router. The router knows which public port relates to which internal IP:Port due to the port forwarding rules you setup.)

    IPv6 version: Think of your public IP:Port as the office, and the reverse proxy as the reception.

    The following will be common to both IP protocols.

    The port is usually 80 or 443, because reverse proxy is used for HTTP(S) connections, and by default those connections use the aforementioned ports.

    When someone connects to your IP:Port, they ask the reverse proxy “hey, can you bring me to Mr. https://my-awesome-plex.xyz ?” and the reverse proxy will act as a middleman between that someone and the actual server that is serving that domain name.

    The reverse proxy, as a middleman, forwards your requests to the server, and the server’s response is forwarded back to you by the reverse proxy too.

    And just to make things complete… Why do we use reverse proxies?

    1. To hide the identity of the actual server. This is easy to understand - you are only ever talking to the proxy, never the actual server. It’s just that your messages are continually forwarded to the actual server.

    2. To save IP addresses. (One public address can serve multiple websites, if the actual servers are given only private IP addresses.)

    3. To load balance. The reverse proxy can direct one to another server if the first server is overloaded. This requires a website to be served by more than one server though, and selfhosters like us never really need it.

    4. To prevent attacks. If the reverse proxy realises that someone has been making too many connections to https://my-awesome-nas.com, the reverse proxy can reject subsequent connections. This is how Cloudflare works.

    5. Caching. If the middleman remembers that the server responded “what is the answer to everything” with “42”, then the next time someone asks the same question again, the middleman will simply reply with the same response. This takes off the workload on the server.


  • I still have firewall (that blocks almost all incoming connections) and sshguard setup. I also check the firewall logs daily, blocking IPs that I find to be suspicious.

    I could probably do better, but with so few scanners connecting to my home server, I have managed to sleep way better than back when I setup a server on IPv4!

    Also, even if my home server gets attacked, at least I know that my other devices aren’t sharing the same IP with them… NAT-less is a godsend.