Setting a Static IP

Issues related to configuring your network
User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Setting a Static IP

Post by jlehtone » 2019/03/31 19:45:05

You have "Router", "Server", "Apple" and a wire to ISP. How have you connected these together?

mark9090
Posts: 13
Joined: 2019/03/22 11:10:36

Re: Setting a Static IP

Post by mark9090 » 2019/03/31 20:10:54

jlehtone wrote:
2019/03/31 19:45:05
You have "Router", "Server", "Apple" and a wire to ISP. How have you connected these together?
The CentOS server and Apple Time Capsule are connected directly to the router with an ethernet cable.

The Apple Time Capsule has a static setup, for test purposes, in which it has utilised IP 81.143.9.98 which is provisioned by the gateway router according to the settings I mentioned in my previous post.

I was merely wondering if this setup can be replicated in the /etc/sysconfig/network-scripts/ifcfg-enp2s0 config file in CentOS? Am I not making any sense here?

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Setting a Static IP

Post by jlehtone » 2019/04/01 06:17:44

Somewhat confusing.

Earlier you did mention "my router" and how it gives the server address 192.168.1.67/24.

"Directly to router"'s logical alternative is "via switch to router", but you probably mean something else.
"Gateway router" ... all edge routers act as the gateway from their subnet to other subnets.

Do you have administrative access to the router that you directly connect with your server?

The "my router" at 192.168.1.254 is the gateway for subnet 192.168.1.0/24 to reach other subnets.
The ISP's router at 81.143.9.102 is the gateway for subnet 81.143.9.96/29 to reach other subnets (except 192.168.1.0/24).
The "my router" at 81.143.9.98 would be the gateway for subnet 81.143.9.96/29 to reach 192.168.1.0/24, if members of 81.143.9.96/29 would know that and "my router" would not block it.


CentOS 7 has two services that do manage network configuration: NetworkManager.service and network.service.
The NetworkManager.service is the default and operates on "talk to daemon" rather than "edit a file" principle.
You do mention "cPanel" that is not part of CentOS. It seems to inject some additional configuration.
Is there a saying about too many cooks making a soup?

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: Setting a Static IP

Post by MartinR » 2019/04/01 07:18:41

(OT)

1662 (from the OED): "Too many Cooks spoils the Broth". Still used in this form 350 years later, however the OED also quotes from 1804: "The more cooks the worse broth." Broth is a thin soup made from the water something (usually meat) has been boiled in with added vegetables, so your "too many cooks making a soup" was not far off, and totally reasonable in context.

mark9090
Posts: 13
Joined: 2019/03/22 11:10:36

Re: Setting a Static IP

Post by mark9090 » 2019/04/01 16:45:31

jlehtone wrote:
2019/04/01 06:17:44
Somewhat confusing.

Earlier you did mention "my router" and how it gives the server address 192.168.1.67/24.

"Directly to router"'s logical alternative is "via switch to router", but you probably mean something else.
"Gateway router" ... all edge routers act as the gateway from their subnet to other subnets.

Do you have administrative access to the router that you directly connect with your server?

The "my router" at 192.168.1.254 is the gateway for subnet 192.168.1.0/24 to reach other subnets.
The ISP's router at 81.143.9.102 is the gateway for subnet 81.143.9.96/29 to reach other subnets (except 192.168.1.0/24).
The "my router" at 81.143.9.98 would be the gateway for subnet 81.143.9.96/29 to reach 192.168.1.0/24, if members of 81.143.9.96/29 would know that and "my router" would not block it.


CentOS 7 has two services that do manage network configuration: NetworkManager.service and network.service.
The NetworkManager.service is the default and operates on "talk to daemon" rather than "edit a file" principle.
You do mention "cPanel" that is not part of CentOS. It seems to inject some additional configuration.
Is there a saying about too many cooks making a soup?
Yes you are correct about NetworkManager.service and network.service.

It would appear that my network.service (/etc/sysconfig/network) file already specifies the DNS and gateway entry correctly so the /etc/sysconfig/network-scripts/ifcfg-eth0 config only requires these additions/changes:
IPADDR=
NETMASK=
BOOTPROTO=static
Sorry for the confusion.

As for cPanel, yes I am aware their product changes the network setup based on separate rules but in their installation requirements they expressly mention the need to make a static setup in /etc/sysconfig/network-scripts/ifcfg-eth0 so I'm not worried about any conflicts.

Post Reply