Articles of linux networking

如何在Raspbian中禁用IGMP

我正在为networking交换机的IGMP和MLD实现编写testing用例。 那些testing用例在Raspbian上运行。 但是,Raspbian似乎经常发送自己的IGMP报告/查询,这会干扰我的testing用例。 我怎样才能禁用这些数据包,无论是全球或给定的接口? 我已经看到了这个答案 ,但没有find哪个进程生成IGMP通信的运气。 据我所知,我没有安装任何需要多播组的应用程序。 因为我需要用Scapy发送和接收IGMP的testing用例,所以在防火墙中阻塞IGMP不是一个select。 这里是有问题的交通: pi@raspberrypi204:~ $ sudo tshark -i any -Y igmp tshark: Lua: Error during loading: [string "/usr/share/wireshark/init.lua"]:46: dofile has been disabled due to running Wireshark as superuser. See http://wiki.wireshark.org/CaptureSetup/CapturePrivileges for help in running Wireshark as an unprivileged user. Running as user "root" and group "root". This could be […]

Centos 7.3 Quagga(ospf)configuration在重新启动后更改

我已经configuration了ospf,如下所示: cat /etc/quagga/ospfd.conf ! ! Zebra configuration saved from vty ! 2017/05/31 10:13:20 ! … … … ! interface foo1 description Tunnel foo1 ip ospf cost 250 ip ospf dead-interval minimal hello-multiplier 4 ! router ospf ospf router-id 10.0.0.1 log-adjacency-changes compatible rfc1583 timers throttle spf 200 400 10000 redistribute kernel network 10.0.0.0./24 area 0.0.0.1 network […]

我如何testing到Keberos KDC(UDP / 88)的networking连接?

我如何testing到Keberos KDC(UDP / 88)的networking连接? Kerberos是否有标准的沟通方式来提供任何输出? 例如HTTP, nc -v google.com 80 GET 将转储网站 nc -v smtp.gmail.com 587 ehlo localhost.localdomain 将转储我有的选项(如starttls) 但是kerberos,作为UDP,我甚至不能testing套接字是否打开,我能够testing是否存在防火墙问题的唯一方法是login到KDC,停止kerberos,并在该端口上启动netcat [[email protected] ~]$ nc -l -u 88 [[email protected] ~]$ nc kdc.example.com -u 88

通过wlan0上的设备访问eth0设备

我使用rasperry pi作为无线接入点,build立了一个专用networking。 我所有的无线设备都能够连接到networking并进行通信(通过wlan0),但是我有一个只有以太网端口的Philips Hue集线器。 我想,例如,使用我的电话(在192.168.0.x)命令集线器(192.168.1.x:80)来改变颜色。 的/ etc /networking/接口: auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet static address 192.168.1.1 netmask 255.255.0.0 network 192.168.1.0 gateway 192.168.0.0 allow-hotplug wlan0 iface eth0 inet static address 192.168.0.1 netmask 255.255.0.0 network 192.168.0.0 /etc/dnsmasq.conf: interface=wlan0 dhcp-range=192.168.0.2,192.168.0.20,255.255.255.0,24h interface=eth0 dhcp-range=192.168.1.2,192.168.1.20,255.255.255.0,24h 在/etc/dhcpcd.conf中也包含了这一行 denyinterfaces wlan0 我已经做了大量的研究,并用iptables(NAT)进行转发,使用第三个接口进行桥接……我只是没有发现任何有类似于我的问题的人在一个盒子中处理无线接入点和eth0连接。 什么是完成我的任务的最好方法? 我将不胜感激关于这个主题的任何指导。 另外,我的子网掩码和网关设置正确吗? 谢谢!

用tc警察限制传入的stream量

我有一个要求限制总stream量到5mbit。 我知道这可以通过使用下面的tc命令来实现。 “tc filter add dev eth0 parent ffff:protocol ip u32 match u32 0 0 police rate 5mbit burst 10k drop flowid:1” 问题:我有两个交通stream,说tcp和udp。 我的目标是将tcp和udp总stream量限制在5mbit,并使tcp的优先级高于udp。 这就是说,如果总传入stream量是7mbit,我只需要5mbit而tcp丢失较less(因为它有更高的优先级)。 我知道我可以写3个不同的规则,例如3mbit和2mbit。 “ tc filter add dev eth0 parent ffff:protocol ip prio 10 u32 match u32 tcp 0xff police rate 3mbit burst 10k drop flowid:1”“tc filter add dev eth0 parent ffff:protocol […]

在16.04发出重新启动networking服务的问题

我在Ubuntu 16.04上为我的专用服务器买了一个新的IP地址,我一直在试图设置它,但是我只是一直遇到一个问题。 即使使用原始configuration,我也无法重新启动networking服务。 这是我通过systemctl status networking.service得到的; systemd[1]: Starting Raise network interfaces… ifup[24985]: RTNETLINK answers: File exists ifup[24985]: Failed to bring up eth0. postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions networking.service: Main process exited, code=exited, status=1/FAILURE Failed to start Raise network interfaces. networking.service: Unit entered failed state. networking.service: Failed with result 'exit-code'. 这里是接口文件的内容(我已经审查了地址当然); auto lo iface lo […]

Linux中的链接层扫描

简短版本:如何确定在以太网networking上存在哪些IP地址,而不必假设它们都在同一个子网上? 长版本:我有一个networking上的设备,我可以SSH通过其以太网端口。 我有另一个设备,我知道是(或应该…)物理连接到同一个networking交换机,但似乎有一个无效的IPconfiguration – 我怀疑它得到一个自动configuration地址。 我可以使用arp-scan –localnet -I eth0来查看我正在查找的设备不存在 – 大概是因为它没有在同一个子网上的IP地址。 有没有办法在一个Linux的盒子(Debian 8)我可以发送一个消息在以太网广播地址,看看有什么答案,而不必假设它在同一个IP子网? 我知道以太网MAC的前六位数字是什么,所以我可以合理地确定是否响应是正确的事情。 奖金点的某种方式,会告诉我它有什么IP地址。 可悲的是,它们不在同一个以太网网段上,只是连接到同一个交换机,所以只是在混杂模式下进行监听并没有达到你所期望的那么多。

Linux服务器两个networking接口

我正在configuration一个带有两个networking接口(enp3s0f0和enp3s0f1)的本地服务器。 我喜欢在同一个子网(192.168.178。*)上拥有不同IP地址(192.168.178.4 | 192.168.178.5)的两个接口(可以在两个设备上具有相同的地址映射)来归档以下: 服务器应该可以通过两个1GBit接口运行2个地址但域名相同。 这样,我想我可以拆分连接DNS-RR,并提供2GBit的function。 服务器被configuration为KVM主机,并且应该能够桥接到客户端的两个接口。 这可以让客户也从2GBit连接中受益。 这是我目前的主机的/ etc / network / interfaces # Loopback device: auto lo iface lo inet loopback # device: br0 auto br0 iface br0 inet static address 192.168.178.4 dns-nameservers 8.8.8.8 netmask 255.255.255.0 gateway 192.168.178.1 bridge_ports enp3s0f0 bridge_stp off bridge_fd 0 bridge_maxwait 0 up route add -host 192.168.178.6 dev br0 […]

lftp连接挂(而不是失败)

我有一个使用lftp连接到服务器并下载文件的自动脚本。 我已经有脚本成功运行了好几次(所以我知道在理论上是有效的)。 最近,我怀疑我们有问题连接到远程服务器(我们不拥有它,所以我不能validation它是“上”还是“下”)。 我知道lftp通过SSH连接。 当我运行lftp程序时,它只是不断尝试重新连接。 /bin/lftp -d -e 'set sftp:connect-program "ssh -a -x -i /home/username/.ssh/id_rsa -o "ConnectionAttempts=1" -o "ConnectTimeout=10" -o "BatchMode=yes" -o "ServerAliveInterval=15""; set cmd:fail-exit on; set dns:max-retries 3; set dns:fatal-timeout 20; set net:max-retries 3; set net:timeout 25; set ssl:key-file /home/username/.ssh/id_rsa; set xfer:clobber on; get OUT/remote_filename.txt -o remote_filename.txt; bye' -uremoteusername,xyz sftp://sftp.remoteserver.com —- Running connect program […]

Ubuntu KVM – 无法通过网桥访问networking,无DHCP,无法ping通

我有一台运行Ubuntu 16.04.3 LTSgraphics的笔记本电脑(安装了Network-Manager等)。 我想我已经正确安装了KVM和QEMU。 当试图从netinstall ISO设置Debian虚拟机时,它无法从DHCP获取地址。 我需要能够从我的笔记本电脑外部访问虚拟机,所以我不能使用NAT。 我试过以下的指示: 如何为虚拟机configuration桥接networking KVM-客人不能通过桥 – 没有互联网连接 KVM客人无法访问互联网 但是还是没有运气。 笔记本电脑是戴尔XPS 13,没有板载网卡。 相反,我有一个TP-Link USB3.0千兆以太网适配器,根据规格页面是一个RTL8153芯片组。 以太网在主机上工作正常。 Wifi已禁用。 我曾尝试通过brctl在Virt-Manager GUI中configuration网桥,并在/ etc / network / interfaces中对其进行定义。 尽我所知,网桥已经正常运行,但是试图在虚拟机之外ping通导致失败。 有一次,我能够ping主机的笔记本电脑的IP,但没有更多的(我不记得我做了什么导致这一点,不再是这种情况,ping任何东西在同一个子网导致数据包消失,ping谷歌在Network is unreachable结果Network is unreachable ,我已经停止了ufw服务,并且另外刷新了iptables规则,但都没有成功,我在同一台机器上有Docker,但是我不知道这是否有什么不同。 主机: 使用ifconfig: root@DB0277:~# ifconfig br0 Link encap:Ethernet HWaddr d4:6e:0e:06:29:c1 inet addr:10.11.x.44 Bcast:10.11.x.255 Mask:255.255.255.0 inet6 addr: fe80::d66e:eff:fe06:29c1/64 Scope:Link UP BROADCAST RUNNING MULTICAST […]