
[英]How can a Kubernetes pod connect to database which is running in the same local network (outside the cluster) as the host?
[英]How to distinguish between local and outside networks with the same network ID
网络 ID 问题:
假设我们有 2 个网络:
Network 1 subnet mask: 255.255.255.0 [11111111.11111111.11111111.00000000]
Network 2 subnet mask: 255.255.254.0 [11111111.11111111.11111110.00000000]
假设我们有一个数据包要发送到另一个 IP 地址:
Source IP address: 4.4.2.1 [00000100.00000100.00000010.00000001]
Subnet mask: 255.255.254.0 [11111111.11111111.11111110.00000000]
Destination IP address: 4.4.2.2 [00000100.00000100.00000010.00000010]
Subnet mask: 255.255.254.0 [11111111.11111111.11111111.00000000] <- we don't know this though as the source
我们如何知道是将数据包发送到另一个网络还是我们的本地网络? 如果我们使用源的子网掩码为源 IP 地址和目标 IP 地址创建网络标识符,则即使目标和源实际上是不同的网络,它们也将具有相同的网络标识符:
Source Network Identifier: 4.4.2.0 [00000100.00000100.00000010.00000000]
Destintation Network Identifier: 4.4.2.0 [00000100.00000100.00000010.00000000]
如何知道目的地是在我们的网络中还是在另一个网络中。 我对如何解决这个问题感到困惑,或者我是否误解了某些东西。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.