Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4733348
  • 博文数量: 930
  • 博客积分: 12070
  • 博客等级: 上将
  • 技术积分: 11448
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-15 16:57
文章分类

全部博文(930)

文章存档

2011年(60)

2010年(220)

2009年(371)

2008年(279)

分类:

2008-08-23 22:32:58

参看已经建立的连接:
      netstat -an | grep "ESTABLISHED" | sort | uniq -c
想得到局域网内哪个IP是在使用的,哪个IP未被使用
    #!/bin/bash
     echo "start"
     for((i=1;i<255;i++));do
        echo -n .
        a=192.9.200.$i
        (ping -c2 $a  > /dev/null 2>&1) && echo $a is used >>ips.txt|| echo $a is unused>>ips.txt
    done
    echo "succeed!"
配置网络
    sudo vi /etc/network/interfaces
    应用:
     iface eth0 inet dhcp(or static)
     address 202.114.85.105
     netmask 255.255.255.0
     gateway 202.114.85.1
   设置为static的时候下面的静态ip就生效了
   命令行使用ifconfig eth0 202.114.85.105 netmask 255.255.255.0

阅读(1039) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~