• Sign in
  • Sign up
Elektrine
EN
Log in Register
Modes
Overview Chat Timeline Communities Gallery Lists Friends Email Vault DNS VPN
Back to Timeline !linux @emotional_soup_88__dup_21417
In reply to 2 earlier posts
@emotional_soup_88__dup_21417@programming.dev on programming.dev Open parent
The behavior of /24 vs /32 addresses when using iptables
I added a rule to accept connections from 192.168.1.135/24, since my router is configured to hand out /24 addresses. Then, iptables -L -v showed that connections from 192.168.1.0/24 are accepted. When I change the rule to accept connections from .135/32 - or from .135 without specifying the subnet -, it not only works as intended, but it also resolves the hostname correctly. Why? unsolicited “why do you still use iptables” advice not welcome :D
Open parent Original URL
0
1
16
@jrgd@lemmy.zip on lemmy.zip Open parent
The routing and firewalling is a bit different in terms of why certain CIDR masks are used. For the router, the /24 prefix is usually defined for itself on the LAN interface to denote the address space it may send route information to, and what addresses are controlled by the device. Almost certainly, (unless using a lower CIDR range and actually handing out /24 blocks to subsequent routers), you are granting /32 IPv4 addresses to your device from your router. For your system firewall, 192.168.1.135/24 is identical to 192.168.1.0/24 as they are the same address space. You’re simply allowing from a subnet of hosts to accept from. Given the /24 mask is 255.255.255.0, it does not matter what the last number of the IPv4 address is, but the lowest possible number to match the mask is standard form. Without knowing what rule(s) specifically are being applied, I couldn’t tell you if your firewall rules are something that would affect hostname resolution of other hosts from your system or not.
Open parent Original URL
0
0
11
0
emotional_soup_88__dup_21417
durinn in !linux
@emotional_soup_88__dup_21417@programming.dev · Mar 03
Just when you think you know something about networking, it turns out you don’t know sh*t. XD Thank you for your exquisite explanation and for immediately realizing what I had been misunderstanding!
View on programming.dev
0
3
0
Sign in to interact

Comments (3)

Showing 0 of 3 cached locally.
Syncing comments from the remote thread. 3 more replies are still loading.

Loading comments...

About Community

linux
Linux
!linux@lemmy.ml

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules
  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc
Related Communities
  • !opensource@lemmy.ml
  • !libre_culture@lemmy.ml
  • !technology@lemmy.ml
  • !libre_hardware@lemmy.ml

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

64669
Members
10906
Posts
Created: June 01, 2019
View All Posts
313k7r1n3

Company

  • About
  • Contact
  • FAQ

Legal

  • Terms of Service
  • Privacy Policy
  • VPN Policy

Email Settings

IMAP: mail.elektrine.com:993

POP3: pop3.elektrine.com:995

SMTP: mail.elektrine.com:465

SSL/TLS required

Support

  • support@elektrine.com
  • Report Security Issue

Connect

Tor Hidden Service

khav7sdajxu6om3arvglevskg2vwuy7luyjcwfwg6xnkd7qtskr2vhad.onion
© 2026 Elektrine. All rights reserved. • Server: 04:31:20 UTC