The Red Hat Enterprise Linux 7 Networking Guide (see link) says that the following syntax should be used to assign a subnet to a gateway:
nmcli connection modify eth0 +ipv4.routes “192.168.122.0/24 10.0.0.1”
How do I adjust the above to accommodate the 255.255.255.248 Subnet Mask and the aa.aa.aaa.aa6 Default Gateway given by an internet service provider? Something like:
nmcli connection modify eth0 +ipv4.routes “255.255.255.248 aa.aa.aaa.aa6”
Note that:
the subnet is given in two different formats.
a. The RHEL7 Networking Guide gives the subnet in the format192.168.122.0/24, while
b. the internet service provider gives the subnet in the format255.255.255.248.What is more,
a. the RHEL7 Networking Guide gives the gateway as a private IP, while
b. the internet service provider gives the gateway as a public IP.
For reference, a Windows laptop is able to connect to the internet and be recognized as one of the 5 valid IP addresses by giving the above information using the following steps:
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
nmcli connection modify eth0 +ipv4.routes “aa.aa.aaa.aa0/29 aa.aa.aaa.aa6”. The RHEL guide assumes you are on a private network, whereas you are using a public IP range, that's all.