zoukankan      html  css  js  c++  java
  • WOL持久化配置

    1. 保证bios和网卡支持WOL唤醒,并关闭低功耗模式
    2. 此命令仅在Ubuntu20.04LTS上测试通过,其余发行版同理,请自测

    参考链接
    https://www.techrepublic.com/article/how-to-enable-wake-on-lan-in-ubuntu-server-18-04/
    https://help.ubuntu.com/community/WakeOnLan#External_Links

    WOL开启设置

    ~ sudo  apt-get install ethtool #安装管理工具
    
    ~ ip a #查询网络状态等信息。。。
    
    ~ sudo ethtool  -s enp1s0 wol g #使能WOL功能
    
    ~ sudo 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: Symmetric Receive-only
    	Supports auto-negotiation: Yes
    	Supported FEC modes: Not reported
    	Advertised link modes:  10baseT/Half 10baseT/Full 
    	                        100baseT/Half 100baseT/Full 
    	                        1000baseT/Half 1000baseT/Full 
    	Advertised pause frame use: Symmetric Receive-only
    	Advertised auto-negotiation: Yes
    	Advertised FEC modes: Not reported
    	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
    	                                     100baseT/Half 100baseT/Full 
    	Link partner advertised pause frame use: Symmetric
    	Link partner advertised auto-negotiation: Yes
    	Link partner advertised FEC modes: Not reported
    	Speed: 100Mb/s
    	Duplex: Full
    	Port: MII
    	PHYAD: 0
    	Transceiver: internal
    	Auto-negotiation: on
    	Supports Wake-on: pumbg
    	Wake-on: g  #标志位为 g 即已开启WOL, d 则相反
    	Current message level: 0x00000033 (51)
    			       drv probe ifdown ifup
    	Link detected: yes
    

    WOL持久化设置(保证重新开机仍然开启网卡的WOL功能)

    创建一个WOL开机进程

    sudo nano /etc/systemd/system/wol.service
    

    写入内容

    [Unit]
    Description=Configure Wake On LAN
    
    [Service]
    Type=oneshot
    ExecStart=/sbin/ethtool -s INTERFACE wol g
    
    [Install]
    WantedBy=basic.target
    

    使systemd知道新的WOL脚本

    sudo systemctl daemon-reload
    

    使能WOL脚本

    sudo systemctl enable wol.service
    

    启用WOL脚本

    sudo systemctl start wol.service
    

  • 相关阅读:
    Python2 和 Python3的区别 更新中
    CentOS下图形界面安装_Orcaale 11g
    Nmap_使用介绍
    shell_innobackup增量备份步骤
    shell_跳板机推送公钥
    shell_clean_log
    shell_xtrabackup_backup_mysql
    gitlab免密登录
    gitlab安装与部署
    git合并分支
  • 原文地址:https://www.cnblogs.com/jzgw/p/wol_Wkae-on_Ubuntu.html
Copyright © 2011-2022 走看看