我想从iptables切换到Brocade/Vyatta,但是在“转换”防火墙规则方面遇到了问题。
这是我的iptable,它能工作:
# Default policy to drop 'everything' but our output to internet
iptables -P FORWARD DROP
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
# Allow established connections (the responses to our outgoing traffic)
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow local programs that use loopback (Unix sockets)
iptables -A INPUT -s 127.0.0.0/8 -d 127.0.0.0/8 -i lo -j ACCEPT
# Allow traffic between VLAN servers
iptables -A INPUT -s 89.55.42.0/28 -j ACCEPT
# Allow SSH
#iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
# Allow ICMP for monitoring
iptables -A INPUT -p icmp -j ACCEPT这是我在Brocade/Vyatta上的尝试:
set security firewall name VLAN-200-IN default-action 'drop'
set security firewall name VLAN-200-IN rule 10 action 'accept'
set security firewall name VLAN-200-IN rule 10 source address '89.55.42.0/28'
set security firewall name VLAN-200-IN rule 20 action 'accept'
set security firewall name VLAN-200-IN rule 20 destination port '22'
set security firewall name VLAN-200-IN rule 20 protocol 'tcp'
set security firewall name VLAN-200-IN rule 30 action 'accept'
set security firewall name VLAN-200-IN rule 30 protocol 'icmp'
set security firewall name VLAN-200-OUT default-action 'accept'附在我的VLAN/VIF上:
interfaces {
bonding dp0bond1 {
address 77.51.23.1/23
mode lacp
vif 200 {
address 89.55.42.0/28
firewall {
in VLAN-200-IN
out VLAN-200-OUT
}
}
vrrp {
vrrp-group 2 {
...
}
}
}
...我正在测试并希望保护VLAN 200,但通过我的示例,我仍然能够通过SIP端口5060向网关后面的服务器发送数据包。我误解了什么?
发布于 2018-03-09 16:57:46
诚然,我不知道这些Vyatta盒,但是如果我们假设VIF配置在行为上类似于Cisco路由器上的SVI (Vlan接口),那么规则的输入和输出方向应该从路由器的VLAN接口的角度来考虑,而不是VLAN本身。
换句话说,In是用于进入此VLAN上的路由器的流量,OUT是用于离开此VLAN上的路由器的流量。IN规则保护路由网络的其余部分不受vif 200接口上的内容的影响。OUT规则保护vif 200接口上的内容不受网络其他部分的影响。
现在您应该看到,使用您非常允许的VLAN-200out策略,您允许将任何东西路由到您的服务器上的vif 200接口。由于5060上的SIP通信量可能是UDP,所以它不需要双向TCP连接设置(可能被IN规则捕获),而是允许通过。
当然,对于这个特定的平台,我可能弄错了--而且并不完全清楚您实际的网络拓扑是什么。大概是Vyatta盒在充当路由器吧?
https://serverfault.com/questions/900450
复制相似问题