icmp

Centos 7的Firewalld防火墙基础

房东的猫 提交于 2019-11-27 07:41:59
一、Linux防火墙的基础 Linux的防火墙体系主要工作在网络层,针对TCP/IP数据包实时过滤和限制,属于典型的包过滤防火墙(或称为网络层防火墙)。Linux系统的防火墙体系基于内核共存:firewalld、iptables、ebtables,默认使用firewalld来管理netfilter子系统。 netfilter:指的是Linux内核中实现包过滤防火墙的内部结构,不以程序或文件的形式存在,属于“内核态”的防火墙功能体系; firewalld:指用来管理Linux防护墙的命令程序,属于“用户态”的防火墙管理体系; 1、firewalld概述 firewalld的作用是为包过滤机制提供匹配规则(或称为策略),通过各种不同的规则,告诉netfilter对来自指定源,前往指定目的或具有某些协议特征的数据包采取何种处理方式。为了更加方便地组织和管理防火墙,firewalld提供了支持网络区域所定义的网络链接以及接口安全等级的动态防火墙管理工具。支持IPv4、IPv6防火墙设置以及以太网桥,并且拥有两种配置模式: 运行配置 永久配置 还支持服务或应用程序直接添加防火墙规则接口。 2、firewalld网络区域 firewalld将所有的网络数据流量划分为多个区域,从而简化防火墙管理。根据数据包的源IP地址或传入网络接口等条件,将数据流量转入相应区域的防火墙规则。

How to ICMPs and traceroutes in Java

吃可爱长大的小学妹 提交于 2019-11-27 06:20:31
问题 Java does not have primitives for ICMPs and traceroute. How to overcome this? Basically I'm building code that should run in *nix and Windows, and need a piece of code that will run in both platforms. 回答1: Here's what I wrote today to "implement" the trace route command in Java. I've only tested in windows but it should work in Linux as well although there are several traceroute tools available for Linux so most likely there need to be some checks for the existence of those programs. public

Troubleshooting “TypeError: ord() expected string of length 1, but int found”

五迷三道 提交于 2019-11-27 03:22:19
问题 ERROR : TypeError: ord() expected string of length 1, but int found I am getting this error while compiling the program. File "C:\Users\Administrator\Desktop\tracer1.py", line 129, in <module> get_route("www.google.com") File "C:\Users\Administrator\Desktop\tracer1.py", line 85, in get_route d = build_packet() File "C:\Users\Administrator\Desktop\tracer1.py", line 62, in build_packet myChecksum = checksum(header + data) File "C:\Users\Administrator\Desktop\tracer1.py", line 28, in checksum

how to icmp ping on android

自闭症网瘾萝莉.ら 提交于 2019-11-27 01:03:17
问题 I need to do a icmp ping to a host from my android device. I need to measure the round trip time. I am proficient with android and java, just dont know what library to use. How do I do it? Is it possible via 3G, Edge? 回答1: Yes you can ping with 3G, edge, wireless whatever, as long as you have connectivity. The only limitation is in the emulator, see here: http://groups.google.com/group/android-developers/browse_thread/thread/8657506be6819297 Here is my ping function: package com.namespace

python non-privileged ICMP

折月煮酒 提交于 2019-11-27 00:56:07
问题 While trying to figure out the best method to ping (ICMP) something from python, I came across these questions: How can I perform a ping or traceroute in python, accessing the output as it is produced? ping a site in python How can I perform a ping or traceroute using native python? The answers generally boil down to "use this third party module with root privileges" or "use the system's ping command and parse the output". Of the native methods, icmplib and M. Cowles and J. Diemer's ping.py

【图文教程】防火墙

时光怂恿深爱的人放手 提交于 2019-11-27 00:24:07
防火墙 1. firewalld和netfilter SELINUX介绍 1. 临时关闭:selinux: 2. 查看关闭状态:getenforce 3. 永久关闭 selinux:编辑 /etc/selinux/config 文件,把 SELINUX 行改为 disabled ,然后重启操作系统: 4. 在 CentOS7 上也可以使用 netfilter 机制的防火墙: 5. 首先关闭 CentOS7 上的 firewalld 服务: 6. 如果想启动 netfilter 服务,我们需要安装 iptables-services 包,安装这个包等于开启了 netfilter 服务: 10.13 netfilter5表5链介绍 1. Nat表映射示意图: 2. netfilter 5链示意图: 10.14 iptables语法 iptables介绍: iptables参数示例: 1. 使用 iptables -nvL 命令查看 iptables 服务自带的一些规则: 2. iptables 的默认规则在 /etc/sysconfig/iptables 文件里保存着: 3. 清除规则使用 iptables -F 命令,这样虽然清空了规则,但是默认规则还会保存在 /etc/sysconfig/iptables 文件里: 4. 重启 iptables 规则: 5. 想要把当前规则保存到

Listen for ICMP packets in C#

纵饮孤独 提交于 2019-11-26 19:55:09
问题 I have a SIP application that needs to send UDP packets to set up the SIP calls. SIP has a timeout mechanism to cope with delivery failures. An additional thing I would like to be able to do is detect whether a UDP socket is closed in order having to wait the 32s retransmit interval SIP uses. The cases I am referring to are when an attempt to send to a UDP socket results in an ICMP Destination Unreachable packet being generated by the remote host. If I attempt to send a UDP packet to a host

15、iptables详解

最后都变了- 提交于 2019-11-26 19:38:46
-- http://www.netfilter.org/ http://www.iptables.org/ --参考路径 http://www.netfilter.org/documentation/index.html#documentation-howto 1,包过滤防火墙 在网络层对数据包进行选择,主要是对数据包的所使用的协议,端口,源地址和目标地址等参数来进行过滤 2,代理网关 squid(代理网关,反向代理web加速) varnish nginx haproxy --后面这几个软件也可以去做反向代理(但不做代理网关) 把内网和外网是完全隔离的,内网和外网不能进行直接的 TCP通讯,必须通过代理网关的处理 .exe .jpg 3,状态检测 TCP有三次握手的阶段,常用的WEB,文件下载,发送和接收邮件等等都是TCP 状态检测防火墙除了包过滤防火墙所考查的参数之外,还要关心数据包连接的状态 可以做安全控制的: tcpwrapper pam 可植入性安全模块 selinux security enhanced linux (在rwx权限之外,进程访问文件或目录加的额外权限) 完整性检测 tripwire 入测检测 snort SSL/TLS 网络传输加密通讯 ip tunnel + ipsec 网络传输加密通讯 netfilter / iptables --iptables

Problem with isReachable in InetAddress class

霸气de小男生 提交于 2019-11-26 18:28:40
问题 As an assignment I have to find all the alive computers on a LAN. For which I am using isReachable function of InetAddress class. But problem is that nothing is shown reachable to me. So I tried to have isReachable with Google's IP but still this is unreachable. Here is the code: import java.net.*; public class alive{ public static void main(String args[]){ try{ InetAddress ia = InetAddress.getByAddress(new byte[]{(byte)209, (byte)85, (byte)153, (byte)104}); boolean b = ia.isReachable(10000);

使用三层交换实现不同网段、不同 vlan 互通

谁说我不能喝 提交于 2019-11-26 18:08:21
上一篇实现了使用 Trunk 做跨交换机 VLAN 通信,这一篇就试试使用三层交换实现不同网段,不同 VLAN 间的通信。 实验拓扑 在一台三层交换机下面连接一台二层交换机,再在二层交换机下面连接两台 VPC ,地址规划如下: 名称 接口 VLAN 地址 PC1 SW1-f1/1 vlan 10 192.168.10.10/24 PC2 SW1-f1/2 vlan 20 192.168.20.10/24 名称 接口 地址 SW2 vlan 10 192.168.10.1/24 SW2 vlan 20 192.168.20.1/24 配置方法 SW2(config)#int vlan 10 SW2(config-if)#ip address 192.168.10.1 255.255.255.0 SW2(config-if)#no shutdown 配置过程 SW1 SW1 关闭路由功能 SW1#conf t SW1(config)#no ip routing SW1 创建 VLAN 10 和 VLAN 20 ,并添加接口。 SW1(config)#vlan 10,20 SW1(config-vlan)#ex SW1(config)#int f1/1 SW1(config-if)#sw m a SW1(config-if)#sw a v 10 SW1(config-if)#int f1