推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
hezhile
V2EX  ›  Python

请问有没有监控内网 IP 地址、MAC 地址的模块?

  •  
  •   hezhile · Jun 18, 2015 · 4260 views
    This topic created in 3992 days ago, the information mentioned may be changed or developed.
    现状:公司的网络没有什么管理,IP分配是记录在一个excel文件里面的。少数几个IP地址可以访问外网,于是有的同事会自己修改IP地址来上网,但是又忘了改回去,导致IP地址冲突。

    需求:有时候调试设备的时候临时要用一些未分配的IP,经常要打开电脑查。有时候要查某个IP是哪个设备在用。想把IP和MAC对应关系的变化记录下来,方便处理网络故障。

    问题:如果有现成的模块,想直接拿来用。如果没有,想自己学着写一个。

    谢谢
    10 replies    2015-06-19 14:48:38 +08:00
    janxin
        1
    janxin  
       Jun 18, 2015
    有路由器么....
    hezhile
        2
    hezhile  
    OP
       Jun 18, 2015
    @janxin 没有,我们是属于一个大局域网里面的几个/24子网。
    orcusfox
        3
    orcusfox  
       Jun 18, 2015
    买交换机
    fangjinmin
        4
    fangjinmin  
       Jun 18, 2015
    用arp和rarp命令可以从ip得到MAC地址, MAC地址得到IP。
    dndx
        5
    dndx  
       Jun 18, 2015 via iPhone
    买个可网管交换机吧。
    ToughGuy
        6
    ToughGuy  
       Jun 18, 2015   ❤️ 1
    024680
        7
    024680  
       Jun 18, 2015   ❤️ 1
    arpwatch?
    tomwen
        8
    tomwen  
       Jun 19, 2015   ❤️ 1
    arp-scan -l
    hezhile
        9
    hezhile  
    OP
       Jun 19, 2015
    @ToughGuy
    @024680
    @tomwen
    谢谢各位
    snip
        10
    snip  
       Jun 19, 2015   ❤️ 1
    set /a x=1
    set whdr=192.168.1
    set /a xlyktime=200


    set /p whdr=请输入要扫描的网段前三位xxx.xxx.xxx(直接回车默认192.168.1):
    set /p xlyktime=请输入响应时间(直接回车默认200毫秒):



    arp -d



    :loop


    echo 正在扫描 %whdr%.%x%
    start /min ping -w %xlyktime% -n 1 %whdr%.%x% >nul
    set /a x=%x%+1


    if %x% neq 255 goto :loop





    echo 正在输出到文件
    ping -n 3 127.0.0.1 >nul
    arp -a>.\网络详细信息.txt
    ipconfig/all >>.\网络详细信息.txt
    echo 文件已经生成在当前目录下
    echo 谢谢使用
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2804 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 12:08 · PVG 20:08 · LAX 05:08 · JFK 08:08
    ♥ Do have faith in what you're doing.