在努力locking一个新的Centos框我正在build设我正在安装iptables。 我希望能够把这个脚本,所以我可以做到这一点的其他箱子,但我得到一些奇怪的错误,回滚需要重新启动? 用。安装 yum install iptables 这工作正常,但在重新启动之前: [root@ip-10-0-0-132 ~]# systemctl start iptables Failed to issue method call: Unit iptables.service failed to load: No such file or directory. [root@ip-10-0-0-132 ~]# systemctl enable iptables Failed to issue method call: Access denied [root@ip-10-0-0-132 ~]# 之后 [root@ip-10-0-0-132 ~]# systemctl enable iptables ln -s '/usr/lib/systemd/system/iptables.service' '/etc/systemd/system/basic.target.wants/iptables.service' [root@ip-10-0-0-132 ~]# systemctl start […]
我想允许一系列的IP地址 – 两/ 24子网,不属于/ 23。 我有两个select: 使用两个 / 24掩码和-s选项的规则 使用-m iprange 单个规则 ,指定ip的全部范围 哪个是最快,更优化的性能方式?
最近我的服务器遭到了中国防火墙的DDoS攻击。 根据http-host头部的mod_security阻止请求中的回复中的build议,以及https://mattwilcox.net/web-development/unexpected-ddos-blocking-china-with-ipset-and-iptables中的build议/我一直在试图使用IPTables阻止来自中国防火墙的redirectDDoSstream量,通过阻止来自“Bittorrent”string的请求,并通过使用最新的IP列表阻止来自中国的所有IP :http:// www.ipdeny.com/ipblocks/data/countries/cn.zone 。 我的防火墙看起来像这样。 *filter # Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0 -A INPUT -i lo -j ACCEPT -A INPUT -d 127.0.0.0/8 -j REJECT # Accept all established inbound connections -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT # Block anything from China # […]
我有一个叫nginx服务器configuration的“legacy”VHost。 它曾经是一个完整的网站,但它已经退役,所有的内容被删除。 server块现在看起来像这样: server { listen 80; server_name defunct-site.com; return 410; } 还有一些DNSlogging和应用程序仍在我的控制之下,仍指向此服务器,尽pipe我向第三方请求更新其configuration并停止尝试访问该站点,但它仍然获得相对显着的stream量。 不用说,我不能改变我的IP地址,没有显着的努力。 有没有更好的方式告诉这些客户他们的stream量不再受欢迎? 来源IP遍布各地,所以做一个成功的iptables块似乎不太可能。 而且我需要读取足够的HTTP请求才能到达Host:头部,以确保我不会破坏用于合法VHost的stream量。
这是一个常见的问题,很容易出现在search中,似乎与防火墙有关,但我似乎无法弄清楚如何解决这个问题。 其实我之前已经问过了 ,但是这次我回来了更多关于这个问题的信息,并且更好的理解了这个问题。 当我的openvpn服务器(位于一个NAT之后)有其外部IP改变,因为我的互联网连接有一个dynamicIP,问题出现。 所以,只要我的外部IP变化,我的VPN客户端不能再连接到服务器。 这是一个令人头疼的问题,因为在重新启动(openvpn服务器,也许还有防火墙)之后,事情通常不会被纠正。 几次重新启动后,虽然事情会得到工作几天,直到我的IP更改。 以下日志是从2(服务器和客户端)slackware linux系统获得的。 我的服务器configuration如下: cd /etc/openvpn proto udp port 32456 comp-lzo verb 1 log-append /var/log/openvpn/server.log status /var/log/openvpn/server-status.log daemon dev tun persist-tun persist-key server 192.168.26.0 255.255.255.0 ifconfig-pool-persist /var/log/openvpn/ipp.txt client-to-client client-config-dir ccd route-gateway 'dhcp' route 192.168.114.0 255.255.255.0 route 192.168.18.0 255.255.255.0 push "route 192.168.112.0 255.255.255.0 vpn_gateway" push "route 192.168.114.0 255.255.255.0" push "route […]
我有一个通过VPN连接到服务器Y的服务器X(45.55.245.182)。 X上的VPN接口是tap0,IP为10.200.0.2; Y上的VPN接口是tap0,IP为10.200.0.1。 我在服务器Y上运行netcat来监听UDP 35000: nc -lu 10.200.0.1 35000 在服务器X上,端口35000的数据包使用以下iptables规则进行DNAT: iptables -t nat -A PREROUTING -p udp –dport 35000 -j DNAT –to-destination 10.200.0.1 在tap0接口上运行服务器Y上的tcpdump会显示数据包按预期发生: 11:54:44.000610 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 10.200.0.1 tell 10.200.0.2, length 28 11:54:44.000638 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.200.0.1 is-at fa:0f:00:1a:57:59 (oui Unknown), length 28 […]
我有一个Mikrotik路由器,看起来像iptables。 我需要设置QoS来确保VoIP电话获得最高的stream量优先级。 我怎么知道什么样的服务使用和如何得到它? 我search,似乎无法findVoIP的ToS。 我现在的规则如下: /ip firewall mangle add chain=forward tos=XXX action=mark-packet new-packet-mark=VoIP passthrough=no comment="voip" disabled=no / queue tree add name="ether1_voip" parent=ether1 packet-mark=VoIP limit-at=0 queue=default priority=2 \ max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s disabled=no
我已经遵循了各种脚本来build立2台linode机器。 都有一个外部和本地的IP。 在一个我已经安装了Redis,我想通过本地IP连接到这台机器。 我应该添加哪些规则来允许从其他的linode访问端口6379(redis),但是不能从互联网的其他端口访问? 我的/etc/iptables.firewall.rules到目前为止: —- *filter # Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0 -A INPUT -i lo -j ACCEPT -A INPUT -d 127.0.0.0/8 -j REJECT # Accept all established inbound connections -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT # Allow all outbound traffic – […]
我在位于美国东西海岸的两个数据中心有几台Linux(Debian)服务器。 我从每个位置select一台服务器作为NTP服务器。 NTP服务器与0-3.us.pool.ntp.org服务器同步时间。 这似乎迄今运作良好。 客户端被configuration为使用ntp1和ntp2。 我在客户端上设置了防火墙规则(UDP 123)。 我的问题是,如何configuration服务器,以便客户端可以使用我的NTP服务器,并防止我的NTP服务器成为公共时间服务器给其他人? 我不知道如何configuration服务器上的/etc/ntp.conf文件,以限制只有我的服务器,因为将有公共/私有IP地址的混合。 现在我有restrict 10.0.0.0 netmask 255.255.255.0 nomodify notrap这将限制每个NTP所在的本地子网。
我有问题,我不能达到3306端口(MySQL),即使我在iptables设置它。 我该如何解决这个问题? root@vps191532:# iptables-save # Generated by iptables-save v1.4.21 on Thu Oct 22 20:42:38 2015 *filter :INPUT ACCEPT [695:36753] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [469:37083] -A INPUT -p tcp -m tcp –dport 3306 -m state –state NEW,ESTABLISHED -j ACCEPT -A OUTPUT -p tcp -m tcp –sport 3306 -m state –state ESTABLISHED -j ACCEPT COMMIT # […]