When an ISP says they'll provide "4 static IPs with 2 usable", they're typically referring to a /30 subnet allocation. In IPv4 networking, this means:
Network Address: X.X.X.0
Usable Hosts: X.X.X.1 and X.X.X.2
Broadcast: X.X.X.3
Here's how you might configure this in a router (Cisco IOS example):
interface GigabitEthernet0/0
ip address 203.0.113.1 255.255.255.252
no shutdown
In this case:
- 203.0.113.0 - Network address (reserved)
- 203.0.113.1 - Your router's WAN interface
- 203.0.113.2 - ISP's gateway
- 203.0.113.3 - Broadcast address
This /30 subnet is the smallest usable network segment in IPv4. It's commonly used for:
- Point-to-point connections
- WAN links between routers
- Leased line terminations
For a Linux server with multiple public IPs, you might configure additional addresses like this:
# Primary IP
ifconfig eth0 203.0.113.1 netmask 255.255.255.252
# Additional IP (if provided in a larger block)
ip addr add 203.0.113.5/29 dev eth0
With only 2 usable IPs, you'll likely need NAT for internal devices. Here's a basic iptables example:
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 203.0.113.1
iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
When testing your connection, remember:
ping 203.0.113.2 # Should respond (ISP gateway)
traceroute 8.8.8.8 # Verify routing path
When an ISP mentions "4 static IPs with 2 usable," they're referring to a /30 subnet allocation in IPv4 networking. Here's the technical breakdown:
Network ID: First IP (reserved) Usable Host 1: Second IP (assignable) Usable Host 2: Third IP (assignable) Broadcast: Fourth IP (reserved)
In point-to-point connections (common with leased lines), ISPs typically allocate /30 subnets because:
- The ISP needs one IP for their router interface
- You need one IP for your router interface
- The remaining two IPs are reserved for network/broadcast addresses
Here's how to configure this in Cisco IOS:
interface GigabitEthernet0/0 ip address 203.0.113.2 255.255.255.252 description ISP Leased Line Connection
Assuming the ISP assigned 203.0.113.0/30:
- 203.0.113.0 - Network address
- 203.0.113.1 - ISP router
- 203.0.113.2 - Your router
- 203.0.113.3 - Broadcast address
For network architects planning NAT configurations:
ip nat pool PUBLIC_POOL 198.51.100.1 198.51.100.2 netmask 255.255.255.252 ip nat inside source list PRIVATE_NETS pool PUBLIC_POOL overload
Remember to account for:
- Port forwarding requirements
- Potential need for 1:1 NAT mappings
- Future expansion constraints
If you need more usable IPs, consider:
# Requesting a /29 subnet (6 usable IPs) instead: ipcalc 203.0.113.0/29 Network: 203.0.113.0/29 HostMin: 203.0.113.1 HostMax: 203.0.113.6 Broadcast: 203.0.113.7
Or implementing PAT (Port Address Translation) if you only need outgoing connectivity:
ip nat inside source list PRIVATE_NETS interface GigabitEthernet0/0 overload