Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3415
  • 博文数量: 3
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 50
  • 用 户 组: 普通用户
  • 注册时间: 2013-07-23 15:01
文章分类
文章存档

2013年(3)

我的朋友

分类: 其他平台

2013-09-17 15:45:13

ifconfig

用来显示所有网络接口的详细情况的,如:ip地址,子网掩码等。

650) this.width=650;" src="http://blog.chinaunix.net/attachment/201205/9/26413552_1336569350GAo7.png" width="598.49" height="129.98" border="0" style="word-wrap:break-word;border:0px" />

ethx是以太网网卡的名称。

配置文件在/etc/sysconfig/network-scripts/ifcfg-eth0中

DEVICE="eth0"

HWADDR="00:0C:29:68:C0:8C"

NM_CONTROLLED="yes"

ONBOOT="yes"  设置为yes则开机的时候启动网卡,no为开机时不启动网卡

BOOTPROTO=dhcp  dhcp设置为动态获取IP,static则设置为静态获取Ip

#IPADDR=192.168.1.5  设置ip地址

#GATEWAY=192.168.1.1  设置网关

#NETMASK=255.255.255.0  设置子网掩码

在手动固定IP时,IPADDR和NETMASK一定要一起写。


ping:

用于检查网络上某台主机是否为活动状态或是否发生故障。原理是利用了TCP/IP协议中的IP层中的ICMP协议从特定的主机上返回响应。

650) this.width=650;" src="http://blog.chinaunix.net/attachment/201205/9/26413552_1336569362Ag2S.png" width="500" height="103" border="0" style="word-wrap:break-word;border:0px" />

如果想禁ping的话,则echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all


netstat ?an

用于显示网络连接、路由表和网络接口信息的。

选项:

a:显示所有套接子的状态。

n:打印实际的地址,加了这个参数速度比较好,消耗内存小。

r:打印路由表。

650) this.width=650;" src="http://blog.chinaunix.net/attachment/201205/9/26413552_1336569371t56A.png" width="596.6999999999999" height="127.5" border="0" style="word-wrap:break-word;border:0px" />

LISTEN代表侦听来自远方的TCP端口的连接请求。在本图中,接收来自任何IP的任何端口去连本机的22端口。

ESTABLISHED代表打开的连接情况。

在Linux中,端口机制是如果一个端口被外部的一起请求占用了,系统会自动复制出来一个和原来的端口一模一样的端口进行侦听下一个外部请求。


route:

用于查看那系统的路由表信息

650) this.width=650;" src="http://blog.chinaunix.net/attachment/201205/9/26413552_1336569385DVEi.png" width="599.46" height="79.53999999999999" border="0" style="word-wrap:break-word;border:0px" />


traceroute

用于追踪网络数据包的路径,数据包的大小默认为40字节。可以知道数据包到达目的地需要经过几个路由。

650) this.width=650;" src="http://blog.chinaunix.net/attachment/201205/9/26413552_13365693968RrE.png" width="599.9399999999999" height="43.56" border="0" style="word-wrap:break-word;border:0px" />


nslook

用于查询一台机器的IP地址和所对应的域名

650) this.width=650;" src="http://blog.chinaunix.net/attachment/201205/9/26413552_1336569406X69S.png" width="402" height="107" border="0" style="word-wrap:break-word;border:0px" />


lsof

主要用于查看特定端口的情况。

650) this.width=650;" src="http://blog.chinaunix.net/attachment/201205/9/26413552_1336569415h8L3.png" width="598.6" height="59.129999999999995" border="0" style="word-wrap:break-word;border:0px" />

上图可以知道22端口被哪些程序所占用


  • 本稿件为独家原创稿件,版权所有,引用或转载请注明出处。
  • 文章出处:
阅读(316) | 评论(0) | 转发(0) |
0

上一篇:500 OOPScannot change directoryroot vsft

下一篇:没有了

给主人留下些什么吧!~~