Mac OS有时需要临时停用网络或者断网,这个情况一般可以通过如下方式实现:

  1. 实用工具启动终端
  2. 执行指令:
    ifconfig

    输出:

    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
    inet 127.0.0.1 netmask 0xff000000
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
    nd6 options=201<PERFORMNUD,DAD>
    gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
    stf0: flags=0<> mtu 1280
    UHC0: flags=0<> mtu 0
    EHC2: flags=0<> mtu 0
    XHC1: flags=0<> mtu 0
    en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=b<RXCSUM,TXCSUM,VLAN_HWTAGGING>
    ether 00:0c:29:b4:5e:72
    inet6 fe80::1cd5:e59b:91b:792d%en0 prefixlen 64 secured scopeid 0x7
    inet 192.168.111.131 netmask 0xffffff00 broadcast 192.168.111.255
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect (1000baseT <full-duplex>)
    status: active
    utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
    options=6403<RXCSUM,TXCSUM,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
    inet6 fe80::b5ee:9a04:f612:701d%utun0 prefixlen 64 scopeid 0x8
    nd6 options=201<PERFORMNUD,DAD>
  3. 以上输出,确认网卡是en0,则执行如下指令断开网络:
    sudo ifconfig en0 down
  4. 当需要恢复网络的时候,执行:
    sudo ifconfig en0 up


Related Posts: Mac OS 怎么停用网络/断网 :

留言