常见的端口状态代表的含义

 在操作linux的时候,查看当前端口是否被占用,或者查看当前开放的端口的时候,不可避免的要识别出当前端口的状态信息。

  •     LISTEN:侦听来自远方的TCP端口的连接请求
  •  SYN-SENT:在发送连接请求后等待匹配的连接请求
  •  SYN-RECEIVED:再收到和发送一个连接请求后等待对方对连接请求的确认
  •  ESTABLISHED:代表一个打开的连接
  •     FIN-WAIT-1:等待远程TCP连接中断请求,或先前的连接中断请求的确认
  •  FIN-WAIT-2:从远程TCP等待连接中断请求
  •  CLOSE-WAIT:等待从本地用户发来的连接中断请求
  •  CLOSING:等待远程TCP对连接中断的确认
  •  LAST-ACK:等待原来的发向远程TCP的连接中断请求的确认
  •  TIME-WAIT:等待足够的时间以确保远程TCP接收到连接中断请求的确认
  •  CLOSED:没有任何连接状态
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ifMib 中可以通过 ifOperStatus 对象 ID 来获取端口状态。ifOperStatus 对象 ID 为 1.3.6.1.2.1.2.2.1.8。 该对象 ID 对应的值表示接口的当前操作状态,其定义如下: ``` ifOperStatus OBJECT-TYPE SYNTAX INTEGER { up(1), down(2), testing(3), unknown(4), dormant(5), notPresent(6), lowerLayerDown(7) } MAX-ACCESS read-only STATUS current DESCRIPTION "The current operational state of the interface. The testing(3) state indicates that no operational packets can be passed. If ifAdminStatus is down(2) then ifOperStatus should be down(2). If ifAdminStatus is changed to up(1) then ifOperStatus should change to up(1) if the interface is ready to transmit and receive network traffic; it should change to dormant(5) if the interface is waiting for external actions (such as a serial line waiting for an incoming connection); it should remain in the down(2) state if and only if there is a fault that prevents it from going to the up(1) state; it should remain in the notPresent(6) state if the relevant interface has not been created by the agent." ::= { ifEntry 8 } ``` 以上是 ifOperStatus 对象 ID 的定义。其中,取值含义如下: - up(1):表示接口处于 UP 状态,即已经准备好传输数据。 - down(2):表示接口处于 DOWN 状态,即不处于可传输数据的状态。 - testing(3):表示接口正在进行测试,无法传输数据。 - unknown(4):表示接口的状态未知。 - dormant(5):表示接口处于休眠状态,等待外部特定事件发生。 - notPresent(6):表示接口不存在。 - lowerLayerDown(7):表示下层接口处于 DOWN 状态,因此本层接口也处于 DOWN 状态。 因此,可以通过 SNMP 协议获取对应端口的 ifOperStatus 对象 ID 的值,从而获得端口状态信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值