1

I'm setting Wake-On-Lan of my CentOS server so that it can be wake up through Internet. I set a static ip address on my server, preserve the ip address on the router and create a static ARP entry of the ip and MAC address of my server.

The problem is, if no active request from my server to outer net, after a few minutes, I will not be able to reach my server in the local network through SSH, ping, etc. And the server can be reached right after I delete the static ARP entry on the router.

If I keep 'ping' some website on my server(say, google.com), the server can always be reached whether I bind the static ARP entry or not. I delete the static ARP entry on the router, and I can find my server's ip and MAC on the router's active ARP client page if my server is 'ping' some website. If I let my server stay idle and don't do anything, after a few minutes, my server's entry will disappear from the router's active ARP client page. In the meantime, I can still reach my server if I don't active the ARP binding entry on the router.

Where am I doing wrong? I checked the ARP binding entry a thousand times and I'm pretty sure I didn't fill the wrong ip address and MAC address.

I'm using CentOS 7, the network setup file are as follows:

TYPE=Ethernet
BOOTPROTO=static
# ====== static ip setup =======
IPADDR=192.168.10.100
NETMASK=255.255.255.0
GATEWAY=192.168.10.1
DNS1=192.168.10.1
NM_CONTROLLED=no
# ==============================
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=enp0
UUID=869753b9-240b-445b-5412-98d88dff542a
DEVICE=enp0
ONBOOT=yes

ethtool enp1s0 shows the following:

[root@192 network-scripts]# ethtool enp1s0
Settings for enp1s0:
Supported ports: [ TP MII ]
Supported link modes:   10baseT/Half 10baseT/Full
            100baseT/Half 100baseT/Full
            1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes:  10baseT/Half 10baseT/Full
            100baseT/Half 100baseT/Full
            1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Link partner advertised link modes:  10baseT/Half 10baseT/Full
                     100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
               drv probe ifdown ifup
Link detected: yes
  • What do you mean by "preserve the ip address on the router" ? Have you set up port-forwarding? Do you have a static IP address allocated (by your service provider)? If you don't have a static IP address, then you'll need some form of dynamic DNS instead. That's all you need to do. You don't need to mess with ARP at all. – garethTheRed Oct 31 '15 at 7:44
  • @garethTheRed, "preserve the ip address on the router" means "a static IP address allocated", the reason I want to bind the ARP is that WOL on my server can only take effect if you send the magic pack soon after you shut down the server. if you shutdown the server and leave it for a period of time(say, one night), the server will not respond to your magic pack. I searched on the Internet and someone say it is because the ARP cache of the router, after you shutdown for a period of time, the router will refresh the ARP cache so that it can't find the server for the ip and mac you give – Wood Oct 31 '15 at 9:51
  • @garethTheRed networking-forum.com/… Only by creating an ARP entry can I let the router remember the ip and MAC address after my server shutdown – Wood Oct 31 '15 at 9:57
  • @garethTheRed simply adding a static IP address in DHCP is not enough, the DHCP can only assign the IP to specific PC after this PC get on line. If this PC is shutdown, it's IP and MAC is removed from the router's DHCP and router will not know where to send the magic pack – Wood Oct 31 '15 at 10:00
  • You make it sound as though the problem is that the router doesnt handle static arp entries. Can you use tcpdump on some other computer on the same subnet to see who is not handling the arps? For WOL, you don't need a mac address on the magic packet, you can send it as a broadcast. The mac address used is in the udp data not the ethernet header. – meuh Oct 31 '15 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.