Setting a Static IP
Re: Setting a Static IP
Do you have console access to this system or are you entirely reliant on ssh connections working?
If you are reliant on ssh then I would contact your supplier and ask them about making this change. You have a very odd setup there with what looks like an RFC1918 private address, presumably being supplied to you by DHCP but then you also have a number of non-RFC1918 addresses on the same interface. Since the only route you have if via the 192.168.1.x gateway, things might get very confused if you do this wrong and you might lock yourself out entirely.
If you are reliant on ssh then I would contact your supplier and ask them about making this change. You have a very odd setup there with what looks like an RFC1918 private address, presumably being supplied to you by DHCP but then you also have a number of non-RFC1918 addresses on the same interface. Since the only route you have if via the 192.168.1.x gateway, things might get very confused if you do this wrong and you might lock yourself out entirely.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Setting a Static IP
I have direct physical console access.TrevorH wrote: ↑2019/03/22 19:18:28Do you have console access to this system or are you entirely reliant on ssh connections working?
If you are reliant on ssh then I would contact your supplier and ask them about making this change. You have a very odd setup there with what looks like an RFC1918 private address, presumably being supplied to you by DHCP but then you also have a number of non-RFC1918 addresses on the same interface. Since the only route you have if via the 192.168.1.x gateway, things might get very confused if you do this wrong and you might lock yourself out entirely.
Re: Setting a Static IP
Well I think you will need to contact your supplier anyway to find out what the ip range is that the DHCP server uses. You cannot pick an ip address from within that range as it might get handed out by the DHCP server to something else. You'll need to specify one that is not within the dhcp pool.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Setting a Static IP
The DHCP server (my router) provides one IP from this range: 192.168.1.64 - 192.168.1.253 to the CentOS server over DHCP but the router also reports that the server is assigning the 81.143.9.98 - 81.143.9.101 range to itself statically. So the router and CentOS server are doing 2 different things at the same time.TrevorH wrote: ↑2019/03/22 19:27:39Well I think you will need to contact your supplier anyway to find out what the ip range is that the DHCP server uses. You cannot pick an ip address from within that range as it might get handed out by the DHCP server to something else. You'll need to specify one that is not within the dhcp pool.
I need the CentOS server to only use the 81.143.9.98 - 81.143.9.101 range. I have no clue how to achieve this safely.
-
- Posts: 1522
- Joined: 2014/05/21 20:16:00
- Location: Central New York, USA
Re: Setting a Static IP
Any chance the real issue is you want to be "visible"/addressable to the Internet?
Re: Setting a Static IP
Post the content of all /etc/sysconfig/network-scripts/ifcfg-* files.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Setting a Static IP
ifcfg-enp2s0
TYPE="Ethernet"
BOOTPROTO="dhcp"
DEFROUTE="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="enp2s0"
UUID="0533dc19-71cc-4eec-9176-7fb5b75a6dc4"
DEVICE="enp2s0"
ONBOOT="yes"
ifcfg-lo
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback
Re: Setting a Static IP
Since nothing there tells it to assign those ip addresses, you need to talk to the people that maintain your DHCP server.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Setting a Static IP
Presumably the following IP's are acquired by cPanel as denoted by cp on the end?
The DHCP server (my router) is certainly not providing the above IP's as it indicating that the CentOS server is obtaining them statically.inet 81.143.9.98/24 brd 81.143.9.255 scope global enp2s0:cp1
valid_lft forever preferred_lft forever
inet 81.143.9.99/24 brd 81.143.9.255 scope global secondary enp2s0:cp2
valid_lft forever preferred_lft forever
inet 81.143.9.100/24 brd 81.143.9.255 scope global secondary enp2s0:cp3
valid_lft forever preferred_lft forever
inet 81.143.9.101/24 brd 81.143.9.255 scope global secondary enp2s0:cp4
Re: Setting a Static IP
My ISP has provided me with the IP address of its DNS server, the gateway IP address, the correct net mask and the static IP address.
Presumably I can now put these details into the network config file like so?
Presumably I can now put these details into the network config file like so?
I have already done a dummy run of the above on my Apple Time Capsule and the Time Capsule gains internet access with the static IP of 81.143.9.98 so presumably no hiccups will arise if I input the same static IP details into /etc/sysconfig/network-scripts/ifcfg-enp2s0 on CentOS?/etc/sysconfig/network-scripts/ifcfg-enp2s0
IPADDR=81.143.9.98
NETMASK=255.255.255.248
GATEWAY=81.145.9.102
DNS1=194.72.9.34