简体   繁体   English

CIDR条目和路由表

[英]CIDR entries and routing tables

I have a question which asks the following: 我有一个问题,提出以下问题:

Suppose a router has the following CIDR entries in its routing table: 假设路由器在其路由表中具有以下CIDR条目:

 Net/Prefix Next Hop 128.96.39.0/24 Interface 0 128.96.39.128/25 Interface 1 128.96.40.0/25 Router 2 192.4.153.0/26 Router 3 default Router 4 

For each of the following IP addresses, what does the router do if a packet with that address arrives? 对于以下每个IP地址,如果具有该地址的数据包到达,路由器将如何处理?

  1. 128.96.39.10; 128.96.39.10;
  2. 128.96.40.12; 128.96.40.12;
  3. 128.96.39.151; 128.96.39.151;
  4. 192.4.153.17; 192.4.153.17;
  5. 192.4.153.90. 192.4.153.90。

I know that /24 means that 24 bits are assigned to the network address meaning that 8 bits are assigned to hosts. 我知道/24表示将24位分配给网络地址,这意味着将8位分配给主机。 How do I get the subnet mask from the IP address represented in decimal and then from there determine where the IP would go? 如何从以十进制表示的IP地址获取子网掩码,然后从那里确定IP的去向?

Well, the most specific subnet is always used first: 好吧,总是最先使用最特定的子网:

/25 is more specific then /24. / 25比/ 24更具体。 In your example, this would mean: 在您的示例中,这意味着:

  1. interface 0 接口0
  2. Router 2 路由器2
  3. interface 1 接口1
  4. Router 3 路由器3
  5. Router 4 路由器4

The Router takes the route with the longest fitting subnet mask. 路由器采用具有最长的子网掩码的路由。

(i) interface 0 (ii) Router 2 (iii) interface 1 (iv) Router 3 (v) Router 4 (i)接口0(ii)路由器2(iii)接口1(iv)路由器3(v)路由器4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM