0

I got a /29 IP allocation from my ISP.

I added them using ifcfg to the range file for my interface: ifcfg-eth0-range:0

(NOTE: I replaced my actual IPs with private IPs here.)

IPADDR_START=192.168.2.0
IPADDR_END=192.168.2.7
NETMASK=255.255.255.255


The IPs in these range show 192.168.2.0 as broadcast address when using ip or ifconfig, but this can't be right? Broadcast address would be 192.168.2.7 if I added them using netmask=255.255.255.248. I checked whether I could reach my host using IP 192.168.2.0 and it works fine.

So this makes me believe it's not really the broadcast address for this IP range.

Have I configured this correctly?

My main IP is 192.168.1.25 Netmask=255.255.255.224 Gateway=192.168.1.1 Broadcast=192.168.1.31

I thought about setting 192.168.1.31 as broadcast address for these additional IPs, but I was told the broadcast address needs to be in the same subnet. Also manually setting the broadcast in ifcfg is deprecated.

What should I do?

EDIT: Added output of ip a and ip r

 #ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.25/27 brd 192.168.1.31 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.2.0/29 brd 192.168.2.0 scope global eth0:1
       valid_lft forever preferred_lft forever
    inet 192.168.2.1/29 brd 192.168.2.0 scope global secondary eth0:2
       valid_lft forever preferred_lft forever
    inet 192.168.2.2/29 brd 192.168.2.0 scope global secondary eth0:3
       valid_lft forever preferred_lft forever
    inet 192.168.2.3/29 brd 192.168.2.0 scope global secondary eth0:4
       valid_lft forever preferred_lft forever
    inet 192.168.2.4/29 brd 192.168.2.0 scope global secondary eth0:5
       valid_lft forever preferred_lft forever
    inet 192.168.2.5/29 brd 192.168.2.0 scope global secondary eth0:6
       valid_lft forever preferred_lft forever
    inet 192.168.2.6/29 brd 192.168.2.0 scope global secondary eth0:7
       valid_lft forever preferred_lft forever
    inet 192.168.2.7/29 brd 192.168.2.0 scope global secondary eth0:8
       valid_lft forever preferred_lft forever
    inet6 fe80::225:90ff:fea6:127e/64 scope link
       valid_lft forever preferred_lft forever
 #ip r
default via 192.168.1.1 dev eth0
192.168.1.0/27 dev eth0 proto kernel scope link src 192.168.1.25
169.254.0.0/16 dev eth0 scope link metric 1002
192.168.2.0/29 dev eth0 proto kernel scope link src 192.168.2.0

7
  • How is 192.168.2.0/29 related to 192.168.1.0/27? You mention both without explanation. Are they configured on and routed to the same interface (or IP, respectively)? Commented Jul 17, 2020 at 21:29
  • @HaukeLaging They are both configured on the same interface (eth0) in this case yes. IPs 192.168.1.25 and 192.168.2.0 -192.168.2.7 belong to the same host here. Commented Jul 17, 2020 at 21:33
  • Add the outputs of ip a and ip r to your question. Is 192.168.1.0/27 a public subnet? And see the subnet routing block I added to my answer. Commented Jul 17, 2020 at 21:45
  • @HaukeLaging I've added the outputs, and yes 192.168.1.0/27 and 192.168.2.0/29 in this case are public subnets. Commented Jul 17, 2020 at 22:17
  • So you do not want to route the new subnet to other systems, the host shall respond to all those addresses itself? Can you reach the 192.168.2.0/29 addresses from the Internet now? Commented Jul 17, 2020 at 22:40

1 Answer 1

1

The subnet 192.168.2.0 to 192.168.2.7 is 192.168.2.0/29 i.e. the netmask is 255.255.255.248, not 255.255.255.255. In 192.168.2.0/29 192.168.2.0 is the network address i.e. not a valid host address.

subnet routing

You have to find out whether your ISP is routing 192.168.2.0/29 to an IP outside that range (e.g. 192.168.1.25) or whether the uplink IP is within that network. If the subnet is routed then you do not need any IP from it on that interface.

4
  • So I should assign these IPs as /29 and not /32? Commented Jul 17, 2020 at 21:34
  • Uplink IP here is 192.168.1.25. Commented Jul 17, 2020 at 22:33
  • @mrmc ip a and ip r show that 192.168.1.1 is the uplink. Commented Jul 17, 2020 at 22:38
  • Understood. Yes that's the gateway for my host. Commented Jul 17, 2020 at 22:45

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.