• 0 Posts
  • 15 Comments
Joined 3 years ago
cake
Cake day: June 10th, 2023

help-circle

  • You might want to use either a /24 address or a /32 address in a firewall rule, depending on what you’re trying to do. The difference is that the /24 one refers to a set of IPs, while the /32 one applies to only one IP.

    Say you’re adding a firewall rule like iptables -A - s 192.168.1.123/32 - j ACCEPT. This will accept all traffic with the source IP 192.168.1.123. If instead you use iptables -A - s 192.168.1.123/24 - j ACCEPT, you’ll accept all traffic with a source IP in the 192.168.1.123/24 subnet, which is all the IPs between 192.168.1.0 & 192.168.1.255.

    In the case of your WiFi IP, the subnet does something different. It tells you which IP addresses you should expect to be able to contact directly, and which you need to contact via a router. 192.168.1.214/24 says that all the IPs between 192.168.1.0 & 192.168.1.255 can be reached directly, whereas IPs outside that range need to be sent to a router.

    ip route will show you the routes a device knows about. It’ll look something like this (simplifying a bit):

    default via 192.168.1.1
    192.168.1.0/24 dev wlan0 src 192.168.1.214
    

    The first line is the default route, which is used when no more specific route exists. It says that you talk to these IPs by sending your traffic to 192.168.1.1 (your wifi router) and it’ll send it on from there.

    The second one says that for IPs in the 192.168.1.0/24, you directly talk to them using your wlan0 interface














  • DNS = Domain Name System. This is used to lookup an IP address (e.g. 123.234.54.32) from a domain name (e.g. lemmy.ml). A DNS query is one of the first things your computer does when you visit a site.

    Plain DNS is unencrypted, which means that anyone with the ability to read your requests (e.g. your ISP) can see the names of sites that you’re visiting.

    TLS = Transport Layer Security. This is a protocol that’s used to create an encrypted connection between your device and another one, in this case the DNS server. When this is used, the content of your DNS requests is hidden. Your ISP can still see that you’re talking to the DNS server, but not what you’re saying to it.

    TLS also allows your device to cryptographically verify the identity of the DNS server. Without it, someone with the ability to modify your connection could change the responses from the DNS server. That would allow them to send you back the IP address of a server they control, rather than the real servers IP.