zoukankan      html  css  js  c++  java
  • linux服务器远程网络开机(wake on lan)

    通过网络可以远程开关机,某些时候比较方便管理机器

    检查服务器是否支持远程网络开机

    [root@lab5101 ~]# ethtool eth0
    Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes: 10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                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: No
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 2
        Transceiver: internal
        Auto-negotiation: onMDI-X: on
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000007 (7) 
                                drv probe linkLink detected: yes
    

    注意这两项:

    Supports Wake-on: pumbg
    Wake-on: g
    

    可以通过命令设置,也可以去bios中设置
    d表示禁用,g表示开启

    [root@lab5101 ~]# ethtool -s eth0 wol g
    

    拿到网卡的mac地址

    [root@lab5101 ~]# ifconfig 
    eth0  Link encap:Ethernet HWaddr 00:30:67:6D:3D:7C 
         inet addr:192.168.5.101 Bcast:192.168.255.255 Mask:255.255.0.0 
         inet6 addr: fe80::215:17ff:fed0:be85/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 
         RX packets:17752 errors:0 dropped:4 overruns:0 frame:0 
         TX packets:1101 errors:0 dropped:0 overruns:0 carrier:0 
         collisions:0 txqueuelen:1000 
         RX bytes:1288183 (1.2 MiB) TX bytes:262525 (256.3 KiB) 
         Interrupt:16 Memory:b1100000-b1120000 
    lo   Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 
         inet6 addr: ::1/128 Scope:Host 
         UP LOOPBACK RUNNING MTU:65536 Metric:1 
         RX packets:62566 errors:0 dropped:0 overruns:0 frame:0 
         TX packets:62566 errors:0 dropped:0 overruns:0 carrier:0 
         collisions:0 txqueuelen:0 
         RX bytes:91540393 (87.2 MiB) TX bytes:91540393 (87.2 MiB)
    

    得到:

    HWaddr 00:15:17:D0:BE:85 
    

    在另外一台服务器上执行:

    [root@lab901 ~]# ether-wake -i eth0 00:30:67:6d:3d:7c
    
  • 相关阅读:
    php利用__callStatic静态调用同类中非静态方法
    Using $this when not in object context错误原因及解决办法
    fastadmin权限修改
    call_user_func()
    php empty()奇怪现象
    LF will be replaced by CRLF in vendor/
    git放弃本地,强制拉取远程
    tp5防xss攻击方法
    php curl
    关于Mac设置alias别名访问服务器
  • 原文地址:https://www.cnblogs.com/zphj1987/p/13575306.html
Copyright © 2011-2022 走看看