大网数据广告活动
服务器运维问答

How to treat broadcast ip address as a normal IP

· 52CE 我爱测

I'm new to networking things. I have a sub-network with 16 IPs (ex: 1.2.3.0 to 1.2.3.15). I'm using lxc for each IP for different purposes, but currently the containers with IP 1.2.3.0 and 1.2.3.15 cannot communicate with other c…

问题原文

原帖链接 · dk1111 · CC BY-SA 4.0

I'm new to networking things. I have a sub-network with 16 IPs (ex: 1.2.3.0 to 1.2.3.15). I'm using lxc for each IP for different purposes, but currently the containers with IP 1.2.3.0 and 1.2.3.15 cannot communicate with other containers in my subnetwork although it can communicate with anything else on the internet. And other containers (from 1.2.3.1 to 1.2.3.14) cannot communicate with 1.2.3.0 and 1.2.3.15 as well. How to solve this problem? The containers use ubuntu 18.04, host also uses ubuntu 18.04.

Here is the lxc config:

lxc.include = /usr/share/lxc/config/common.conf
lxc.mount.entry = /sys/kernel/debug sys/kernel/debug none bind,optional 0 0
lxc.mount.entry = /sys/kernel/security sys/kernel/security none bind,optional 0 0
lxc.mount.entry = /sys/fs/pstore sys/fs/pstore none bind,optional 0 0
lxc.mount.entry = mqueue dev/mqueue mqueue rw,relatime,create=dir,optional 0 0
lxc.arch = linux64
lxc.rootfs.path = dir:/var/lib/lxc/con0/rootfs
lxc.uts.name = con0
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.ipv4.address = ...
lxc.net.0.ipv4.gateway = ...
lxc.net.0.hwaddr = ...

已采纳解答

原帖链接 · Alex Moore · CC BY-SA 4.0

It sounds like you are using a /28 subnet with a netmask of 255.255.255.240. In that case:

.0 is the network address .15 is the broadcast address

These cannot be used as host IPs because as you have found other hosts on that same subnet will struggle to communicate.

If you need more hosts you need to increase the network size.

The next size up would be /27 with a netmask of 255.255.255.224, that would give you 30 usable host IPs with .0 still being the network address and .31 being the broadcast.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-07-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。