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

Can a router have the same ip on both sides?

· 52CE 我爱测

I intend to implement an interconnected star topology network. For this, I am using 3 routers: Router A, A1 and A2. internet | Router A 172.16.0.1 /16 / \ / \ / \ A1 A2 172.16.1.1 /24 172.16.2.1 /24 /\ /\ hosts hosts I wish to as…

问题原文

原帖链接 · Radu Marinescu · CC BY-SA 4.0

I intend to implement an interconnected star topology network. For this, I am using 3 routers: Router A, A1 and A2.

           internet
              |
           Router A
         172.16.0.1 /16
          /         \
         /           \
        /             \
     A1                A2
172.16.1.1 /24    172.16.2.1 /24
     /\                /\
    hosts             hosts

I wish to assign the IPs in a hierarchical manner, to allow the subnets A1 and A2 be independently managed and further broken into even smaller subnets.

How should I configure the IP address of each interface in this situation?

Could I use the same IP (172.16.1.1) on both A1's interfaces?

Lets say eth0:172.16.1.1/16 and br1:172.16.1.1/24

I would actually want to use host address 0, but I've omitted that above to avoid confusion, so I wrote 1 instead.

已采纳解答

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

You technically could use the same address on both interfaces, but the traffic for /24 will only go to the interface with that subnet, since routing follows the longest network prefix. However, if the interface with the /24 is down, traffic for that subnet will go to the /16 interface, where it will die.

Best practice is not to have overlapping ranges, unless you have a specific requirement

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

资料来源与适用范围

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

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

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