How do I configure a CentOS7 server to connect to the internet and be known as a specific IPv4 address in the form of:
HERE ARE THE DETAILS (Updated 2/27/2017):
A Cisco DPC3941B (see link) router from an internet access provider has a Gateway IP
aa.aa.aaa.aa6, and has several IP addresses allocated to it in the form of
aa.aa.aaa.aa5. It also has subnet mask
255.255.255.248 and DNS
CentOS 7 Config
nmcli con show gives results including
eno1 uuid 802-3-ethernet eno1.
nmcli con show eno1 gives a lot of output, including:
IPV4.ADDRESS: aa.aa.aaa.aa2/29 IPV4.GATEWAY: aa.aa.aaa.aa6 IPV4.DNS: bb.bb.bb.bb IPV4.DNS: bb.bb.cc.cc
But yet when I
ping google.com from the same terminal, the response is
connect: Network is unreachable. And when I try to Putty to
aa.aa.aaa.aa2 from another computer, the connection times out without connecting. Similarly, typing
ping aa.aa.aaa.aa2 from another computer also times out with 0% packet return.
In case this is a firewall issue, I typed
firewall-cmd --zone=public --list-all and got:
public (default, active) interfaces:eno1 sources: services: dhcpv6-client ssh ports: masquerade: no forward-ports: icmp-blocks rich rules:
How A Windows Machine Is Configured to Do The Same Thing Successfully
To rule out the possibility that the problem might be caused by the cable modem, I connected a Windows laptop to the modem with the following steps outlined below, and am able to connect to the internet and be seen as
aa.aa.aaa.aa1 when using the Windows laptop through a different ethernet cable connected to the same modem.
Here are the steps that get the Windows laptop to connect to the internet as
aa.aa.aaa.aa1 through the same cable modem:
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
Pinging The Cable Modem's Local IP
The Windows command prompt is able to successfully ping the Cable modem by typing
ping 10.x.x.x, which is the local IP for the cable modem.
But when I type the identical
ping 10.x.x.x from the CentOS 7 server's terminal, the response is
connect: Network is unreachable.
Ethernet cable lit on both ends
The Ethernet jack on the server is lit up indicating that it is connected, and the Ethernet jack on the other end of the server cable attached to the cable modem is also lit up indicating that it is connected. So there is an electrical connection between the CentOS 7 server and the cable modem.
The problem seems isolated to the CentOS 7 config.
Setting Up A Route To The Cable Modem From CentOS
The Internet Service Provider gave this link containing information about how to set up a connection between a generic machine and the local modem. The link is for a different kind of connection, but the ISP said it could be adapted.