这Red Hat Enterprise Linux 7 网络指南(请参阅链接)表示应使用以下语法将子网分配给网关:
nmcli connection modify eth0 +ipv4.routes “192.168.122.0/24 10.0.0.1”
如何调整上述内容以适应互联网服务提供商提供的255.255.255.248
子网掩码和默认网关?aa.aa.aaa.aa6
就像是:
nmcli connection modify eth0 +ipv4.routes “255.255.255.248 aa.aa.aaa.aa6”
注意:
子网以两种不同的格式给出。
A。 RHEL7 网络指南以 格式给出子网192.168.122.0/24
,而
b。互联网服务提供商以 格式给出子网255.255.255.248
。更重要的是,
a. RHEL7 网络指南将网关视为私有IP,而
b。互联网服务提供商将网关作为公共IP。
作为参考,通过使用以下步骤提供上述信息,Windows 笔记本电脑能够连接到互联网并被识别为 5 个有效 IP 地址之一:
1. Control Panel > Network and Internet > Network and Sharing Center
2. Click “Change Adapter Settings”
3. Right click on “Ethernet 2” connection and click on “Properties”
4. Select “Internet Protocol Version 4 (TCP/IPv4)”
5. Then click on “Properties” Button to open the target dialog box:
a. In the default state, the “Obtain IP address automatically” option is checked
b. To claim a specific IP instead, click “Use The Following IP Address” and enter the following information:
i. IP Address: aa.aa.aaa.aa1
ii. Subnet Mask: 255.255.255.248
iii. Default Gateway: aa.aa.aaa.aa6
iv. Preferred DNS Server: bb.bb.bb.bb
v. Alternate DNS Server: bb.bb.cc.cc
vi. Check the “Validate Settings on Exit” option.
vii. Click OK
6. Click on any other open dialog boxes to return computer to normal state