1

I have a static IP address allocated by my Internet provider. However, support told me I have to use DHCP on my network interface, otherwise it may not work (and it actually does only work with DHCP). IP allocated with DHCP is always the same.

When saying "does not work" I mean it actually works for some time (a few minutes/hours), then is stops working (I can't ping or nslookup anything).

So my question is: why is this so and what can I do to make this work the static way? I'm using Centos 7, and I encounter issues when getting my IP through DHCP. My Wi-Fi access point stops working sometimes, and IP forwarding to LAN, too. When setting IP the static way, it works OK.

TYPE="Ethernet"
# BOOTPROTO="static"
BOOTPROTO="dhcp"
DEFROUTE="yes"

DEVICE="enp5s0"
ONBOOT="ys"

# IPADDR="*.*.*.*"
# NETMASK="255.255.255.0"
# GATEWAY="*.*.*.*"

DNS1="8.8.8.8"
DNS2="8.8.4.4"

NM_CONTROLLED="no"
ZONE="public"

I was not able to Google either of issues, because my knowledge on these topics is rather limited. My provider support is also rather poor, I was did not manage to get much support from them.

Dave M
  • 4,494
  • 21
  • 30
  • 30
ololoepepe
  • 111
  • 1
  • 1
    i belive your question better fits your needs on superuser.com as it is clearly private usage as you lacking of required skills to debug – djdomi Mar 28 '21 at 09:01
  • The problem is more likely with your AP configuration. You should open a new question at superuser.com and include your network diagram + configuration information over there. – Tero Kilkanen Mar 28 '21 at 14:52
  • It sounds to me like the static IP should go in the router/modem and the Centos box should just be grabbing a private IP from it. No offense, but the alternative of setting up your network to pass the static IP thru the router to your Centos box and then letting Centos be the router is a little ambitious for somebody with limited knowledge. – Brandon Xavier Mar 28 '21 at 15:23
  • Well, I acaually have *some* knowledge (I managed to maintain a tiny Kubernetes cluster of 3 geographically distributed nodes for 2+ years). But I do not have deep understanding of, for example, all layers of OSI model. Morover, English is not my native language, so even when I know what I want to google, I sometimes don't know how to translate it to English. – ololoepepe Mar 29 '21 at 05:46
  • I need a static IP for my "Centos box" to work as a Kubernetes node. And using a router in front of it means port forwaring in order for the node to be available to the outer Internet. Also that means extra device (and extra costs, of course). – ololoepepe Mar 29 '21 at 05:50

1 Answers1

-1

This is probably because your ISP had disabled the ability for you to assign a static IP address, and they probably reject your packets when you do that. It makes a lot of sense if you think about it, because if they accepted your static IP address, and you decided to use someone else's IP address, then you could wreak a lot of havoc on their network.

So they hard-encode the mac-address of your router to be assigned the IP address of their choosing, which is how you get a static IP address. You should be free however, to define your own DNS servers.

Shōgun8
  • 194
  • 1
  • 10
  • Requiring DHCP does not always mean tying it to MAC address 1) auth via DHCP options 2) IPv6 uses DHCP unique identifiers not MACs – John Mahowald Mar 28 '21 at 13:20
  • That's irrelevant in this scenario; the jist of the issue is that the ISP is probably denying statically set IP addresses. So why assume his unknown ISP is NOY using MAC addresses and who said anything about IPv6? – Shōgun8 Mar 29 '21 at 12:41