0

I'm wondering if I can use the network and broadcast IP addresses of a /24 subnet, when the /24 subnet is included in a larger /22 subnet range for NAT?

PS: Please consider that 198.51.0.0/22 is Public IPv4 address for NAT.

For example, i have 4 times /24 subnets such as:

  • 198.51.0.0/24
  • 198.51.1.0/24
  • 198.51.2.0/24
  • 198.51.3.0/24

I'm using them all for NAT. In this case i'm using their only usable IPs such as:

-198.51.0.1 to198.51.0.254
-198.51.1.1 to198.51.1.254
-198.51.2.1 to198.51.2.254
-198.51.3.1 to198.51.3.254

But i wanted them to use aggregated/summarized like this: -198.51.0.0/22

Which means i have to use NAT like: -198.51.0.1 to198.51.3.254

In this case, Network and broadcast IPs such as:

198.51.0.255
198.51.1.0
198.51.1.255
198.51.2.0
198.51.2.255
198.51.3.0

are used for NAT. Is it really okay to use like this?

5
  • Please do not use any public IP addresses that you do not own, not even in an example - I have replaced 1.x by 10.x for you.
    – Zac67
    May 3, 2023 at 7:47
  • Please specify "use for NAT" - is 10.x used for a public, outbound NAT pool? Are you source NATing private 10.x to something else?
    – Zac67
    May 3, 2023 at 7:49
  • Okay, Thank you for correcting and sorry for using real public IP that i don't own in example. But in my question, i asked about real Public IPs for NAT full-cone. i'll change that 10.X private IP to X.X.0.0 ? So i hope it that people won't get wrong idea tho.
    – Ulteara
    May 3, 2023 at 7:58
  • The best way is to use documentation IP addresses ;)
    – JFL
    May 3, 2023 at 8:04
  • @jfl The doc ranges are only 192.0.2.0/24 (TEST-NET-1), 198.51.100.0/24 (TEST-NET-2), and 203.0.113.0/24 (TEST-NET-3) - not /16!
    – Zac67
    May 3, 2023 at 9:03

3 Answers 3

2

Yes you can simply use the 198.51.0.0/22, and any addresses apart 198.51.0.0 and 198.51.3.255 are host addresses within that subnet.

This requires that you don't have any address within that subnet configured with a /24 suffix anywhere on your network.

The other way around:
If you have the 198.51.7.0/24 network, then you can have a host with address 198.51.7.128/24

If you subnet this network in two, you get:

  • 198.51.7.0/25
  • 198.51.7.128/25

Now, 198.51.7.128 beacame the network address of 198.51.7.128/25 and you can no more use it as a host address.

(Nor 198.51.7.127 which is the broadcast address of 198.51.7.0/25).

2
  • Thank you for answering, I'm lack of experience and knowledge. So i wanted to learn from experienced engineers :). So do you have similiar experience like using 198.51.1.0 and 198.51.1.255 IPs for NAT and there's no problem? since you only announced your IP as /22 SUBNET?
    – Ulteara
    May 3, 2023 at 8:08
  • Yes, there's nothing special about a /24 compared to a /22, except it is more readable for humans. If you convert the address and subnet mask in binary you'll see 198.51.1.255 for example is a perfectly normal host address within 198.51.0.0/22 The 0 and 255 are no magic number, it's better to think about "the first and last addresses in the subnet".
    – JFL
    May 3, 2023 at 8:15
1

If the /22 isn't attached to an interface - just a route entry, then there is no "network" and "broadcast", it's just a block of addresses. So, if the ISP is routing the /22 to a WAN address, you can use every last address. Yes, it will be confusing to people seeing zeros and 255's in addresses, but they are perfectly valid.

(I've done this many times. But no one's ever routed me something as big as a /22. :-) In Cisco IOS, if you enter the pool as xxx/22, it will automatically exclude the zero and 255 addresses. Entered as a range, it will use every address given.)

0

In my opinion, i don't see any problem to use /22 network on NAT as long as i reserve /22 subnet's Network and Broadcast IPs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.