由于所有 内部 MASQed 机器不应该有官方分配的互联网地址,因此必须有一种特定且被接受的方式来为这些机器分配地址,而不会与其他任何人的互联网地址冲突。
来自原始的 IP 地址伪装 FAQ
RFC 1918 是关于在未连接或“私有”网络中使用 IP 地址的官方文档。专门为此目的预留了 3 个数字块。
Section 3: Private Address Space The Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IP address space for private networks: 10.0.0.0 - 10.255.255.255 172.16.0.0 - 172.31.255.255 192.168.0.0 - 192.168.255.255 We will refer to the first block as "24-bit block", the second as "20-bit block", and the third as "16-bit" block". Note that the first block is nothing but a single class A network number, while the second block is a set of 16 continuous class B network numbers, and the third block is a set of 255 continuous class C network numbers. |
为了记录,我个人偏好使用 192.168.0.0 网络和 255.255.255.0 C 类子网掩码,因此本 HOWTO 也反映了这一点。以上任何私有网络都是有效的,但请务必使用正确的子网掩码。
因此,如果您正在使用 C 类网络,您应该将启用 TCP/IP 的机器编号为 192.168.0.1、192.168.0.2、192.168.0.3、...、192.168.0.x
192.168.0.1 通常设置为内部网关或 Linux MASQ 机器,用于连接外部网络。请注意,192.168.0.0 和 192.168.0.255 分别是网络地址和广播地址(这些地址是保留的)。避免在您的机器上使用这些地址,否则您的网络将无法正常运行。