配置过滤器以允许预期流量
您必须显式配置 防火墙过滤器 ,以允许预期流量(例如 DHCP 流量)通过。否则,当过滤器应用于接口时,预期流量将被拒绝。此要求适用于经典和快速更新筛选器。
以下示例显示了可用于接受 DHCP 流量的快速更新过滤器。您实际使用的过滤器取决于网络中的预期流量。
在此示例中,术语 allow-dhcp 接受来自所有源地址的所有 DHCP 流量。术语还包括以下选项 only-at-create ,用于指定仅在首次应用过滤器时应用术语。术语包括 sub-allow-dhcp Junos OS 预定义变量 $junos-subscriber-ip-address,它允许所有特定于用户的 DHCP 流量。
match-order语句配置列出了从最具体到最不具体的条件,如配置快速更新过滤器的匹配顺序中所建议的那样。由于此过滤器旨在允许入口 DHCP 流量,因此会首先列出该source-address条件。
firewall {
family inet {
fast-update-filter psf1 {
interface-specific;
match-order [ source-address destination-address protocol destination-port ];
term allow-dhcp {
only-at-create;
from {
source-address 0.0.0.0/32;
destination-address 255.255.255.255/32;
destination-port 67;
protocol udp;
}
then accept;
}
term sub-allow-dhcp {
from {
source-address $junos-subscriber-ip-address;
destination-address 192.168.1.2/32;
destination-port 67;
protocol udp;
}
then accept;
}
}
}
}