@@ -41,6 +41,105 @@ Here is an example on how to run it with the exported config:
4141 --src-ip 10.57.65.44 \
4242 --dst-ip 1.1.1.1
4343
44+ Example
45+ *******
46+
47+ **Note **: NAT is not yet implemented for this example.
48+
49+ .. code-block :: bash
50+
51+ ftf-cli --firewall-system ' opnsense' \
52+ --file-ruleset ' testdata/plugin_translate_opnsense_config.xml' \
53+ --file-interfaces ' testdata/plugin_translate_opnsense_network.json' \
54+ --file-routes ' testdata/plugin_translate_opnsense_network.json' \
55+ --src-ip 10.34.28.206 \
56+ --dst-ip 1.1.1.1 \
57+ --port 993
58+
59+ > ⚠ FIREWALL PLUGIN: Unable to resolve alias DNS: " test.some-invalid-domain.oxl.aaaa"
60+ > ⚠ FIREWALL PLUGIN: Unsupported alias-type " geoip" will be skipped: " GEOIP_NEARBY"
61+ > ⚠ FIREWALL PLUGIN: Unable to parse rule-address: " GEOIP_NEARBY"
62+ > ⚠ FIREWALL PLUGIN: Unsupported rule: Chain floating, Rule 15
63+ > ⚠ FIREWALL PLUGIN: Unable to parse rule-address: " GEOIP_NEARBY"
64+ > ⚠ FIREWALL PLUGIN: Unsupported rule: Chain interfaces, Rule 9 (GeoIP Block)
65+ > ⚠ FIREWALL PLUGIN: Unable to parse rule-address: " GEOIP_NEARBY"
66+ > ⚠ FIREWALL PLUGIN: Unsupported rule: Chain interfaces, Rule 80
67+ > ⚠ FIREWALL PLUGIN: Unable to parse rule-address: " GEOIP_NEARBY"
68+ > ⚠ FIREWALL PLUGIN: Unsupported rule: Chain interfaces, Rule 85 (SVC_1 Proxies)
69+ > 🛈 ROUTER: Packet inbound-interface: lan (LAN)
70+ > 🛈 ROUTER: Packet inbound-route: 10.34.28.0/24, scope link
71+ > 🛈 FIREWALL: Processing Chain: Table " default" ip | Chain " dnat" ip nat (0 rules)
72+ > 🛈 ROUTER: Packet outbound-interface: opt5 (WAN2)
73+ > 🛈 ROUTER: Packet outbound-route: 0.0.0.0/0, gw 169.169.169.1, scope global
74+ > 🛈 FIREWALL: Processing Chain: Table " default" ip | Chain " floating" ip filter (15 rules)
75+ > 🛈 FIREWALL: > Chain floating | Rule 1
76+ > 🛈 FIREWALL: > Chain floating | Rule 2
77+ > 🛈 FIREWALL: > Chain floating | Rule 3
78+ > 🛈 FIREWALL: > Chain floating | Rule 4
79+ > 🛈 FIREWALL: > Chain floating | Rule 5
80+ > 🛈 FIREWALL: > Chain floating | Rule 6
81+ > 🛈 FIREWALL: > Chain floating | Rule 7
82+ > 🛈 FIREWALL: > Chain floating | Rule 8
83+ > 🛈 FIREWALL: > Chain floating | Rule 9
84+ > 🛈 FIREWALL: > Chain floating | Rule 10
85+ > 🛈 FIREWALL: > Chain floating | Rule 11
86+ > 🛈 FIREWALL: > Chain floating | Rule 12
87+ > 🛈 FIREWALL: > Chain floating | Rule 13
88+ > 🛈 FIREWALL: > Chain floating | Rule 14
89+ > 🛈 FIREWALL: > Chain floating | Rule 1000000 | Match => goto
90+ > 🛈 FIREWALL: > Chain floating | Sub-Chain: interface_groups (8 rules)
91+ > 🛈 FIREWALL: > Chain interface_groups | Rule 1
92+ > 🛈 FIREWALL: > Chain interface_groups | Rule 2
93+ > 🛈 FIREWALL: > Chain interface_groups | Rule 3
94+ > 🛈 FIREWALL: > Chain interface_groups | Rule 4
95+ > 🛈 FIREWALL: > Chain interface_groups | Rule 5 | Match => accept
96+ > 🛈 FIREWALL: Processing Chain: Table " default" ip | Chain " snat" ip nat (0 rules)
97+ > ⚠ FIREWALL: Source is bogon-network and heading to Public-WAN without SNAT!
98+ > ✓ FIREWALL: Packet passed
99+
100+ **Block Example **:
101+
102+ .. code-block :: bash
103+
104+ ftf-cli ... --src-ip 10.34.28.206 --dst-ip 1.10.16.4
105+
106+ ...
107+ > 🛈 ROUTER: Packet inbound-interface: lan (LAN)
108+ > 🛈 ROUTER: Packet inbound-route: 10.34.28.0/24, scope link
109+ > 🛈 FIREWALL: Processing Chain: Table " default" ip | Chain " dnat" ip nat (0 rules)
110+ > 🛈 ROUTER: Packet outbound-interface: opt5 (WAN2)
111+ > 🛈 ROUTER: Packet outbound-route: 0.0.0.0/0, gw 169.169.169.1, scope global
112+ > 🛈 FIREWALL: Processing Chain: Table " default" ip | Chain " floating" ip filter (15 rules)
113+ > 🛈 FIREWALL: > Chain floating | Rule 1
114+ > 🛈 FIREWALL: > Chain floating | Rule 2 | Match => drop
115+ > ✖ FIREWALL: Packet blocked by rule: Seq 2, Action: drop, Rule: # 2 "SpamHaus DROP Block Outbound"
116+ > > Matches: {' proto_l3' : ' ip4' , ' ip_saddr' : {' ==' : ' any' }, ' ip_daddr' : {' ==' : [' 1.10.16.0/20' , ' 1.19.0.0/16' , ' 1.32.128.0/18' , ' 2.56.192.0/22' , ' 2.57.122.0/24' , ' 2.57.232.0/23' , ' 2.57.234.0/23' , ' 2.59.152.0/24' , ' 2.59.154.0/24' , ' 5.42.92.0/24' , ' 5.105.220.0/24' , ' 5.133.101.0/24' , ' 5.134.128.0/19' , ' 5.183.60.0/22' , ' 5.183.129.0/24' , ' 5.188.10.0/23' , ' 5.188.11.0/24' , ' 5.188.236.0/23' , ' 14.128.32.0/20' , ' 14.128.48.0/21' , ' 14.152.94.0/24' , ' 23.94.58.0/24' , ' 23.129.252.0/23' , ' 23.137.100.0/24' , ' 23.146.240.0/24' ...
117+
118+ ** Increased Verbosity** :
119+
120+ Use the :code:` verbosity` flag to get more information about the rules and matching.
121+
122+ .. code-block:: bash
123+
124+ ftf-cli ... --src-ip 10.34.28.206 --dst-ip 1.10.16.4 --verbosity 2
125+
126+ ...
127+ > 🛈 ROUTER: Packet inbound-interface: lan (LAN)
128+ > 🛈 ROUTER: Packet inbound-route: 10.34.28.0/24, scope link
129+ > 🛈 FIREWALL: Processing Chain: Table " default" ip | Chain " dnat" ip nat (0 rules)
130+ > 🛈 FIREWALL: Flow-type: forward
131+ > 🛈 ROUTER: Packet outbound-interface: opt5 (WAN2)
132+ > 🛈 ROUTER: Packet outbound-route: 0.0.0.0/0, gw 169.169.169.1, scope global
133+ > 🛈 FIREWALL: Processing Chain: Table " default" ip | Chain " floating" ip filter (15 rules)
134+ > 🛈 FIREWALL: > Chain floating | Rule 1 | Seq 1, Action: accept, Rule: # 1
135+ > > Matches: {' proto_l3' : ' ip4' , ' ip_saddr' : {' ==' : [' 192.168.0.0/30' ]}, ' ip_daddr' : {' ==' : [' 192.168.0.0/30' ]}}
136+ >
137+ > 🛈 FIREWALL: > Chain floating | Rule 2 | Match => drop | Seq 2, Action: drop, Rule: # 2 "SpamHaus DROP Block Outbound"
138+ > > Matches: {' proto_l3' : ' ip4' , ' ip_saddr' : {' ==' : ' any' }, ' ip_daddr' : {' ==' : [' 1.10.16.0/20' , ' 1.19.0.0/16' , ' 1.32.128.0/18' , ' 2.56.192.0/22' , ' 2.57.122.0/24' , ' 2.57.232.0/23' , ' 2.57.234.0/23' , ' 2.59.152.0/24' , ' 2.59.154.0/24' , ' 5.42.92.0/24' , ' 5.105.220.0/24' , ' 5.133.101.0/24' , ' 5.134.128.0/19' , ' 5.183.60.0/22' , ' 5.183.129.0/24' , ' 5.188.10.0/23' , ' 5.188.11.0/24' , ' 5.188.236.0/23' , ' 14.128.32.0/20' , ' 14.128.48.0/21' , ' 14.152.94.0/24' , ' 23.94.58.0/24' , ' 23.129.252.0/23' , ' 23.137.100.0/24' , ' 23.146.240.0/24' ...
139+ >
140+ > ✖ FIREWALL: Packet blocked by rule: Seq 2, Action: drop, Rule: # 2 "SpamHaus DROP Block Outbound"
141+ > > Matches: {' proto_l3' : ' ip4' , ' ip_saddr' : {' ==' : ' any' }, ' ip_daddr' : {' ==' : [' 1.10.16.0/20' , ' 1.19.0.0/16' , ' 1.32.128.0/18' , ' 2.56.192.0/22' , ' 2.57.122.0/24' , ' 2.57.232.0/23' , ' 2.57.234.0/23' , ' 2.59.152.0/24' , ' 2.59.154.0/24' , ' 5.42.92.0/24' , ' 5.105.220.0/24' , ' 5.133.101.0/24' , ' 5.134.128.0/19' , ' 5.183.60.0/22' , ' 5.183.129.0/24' , ' 5.188.10.0/23' , ' 5.188.11.0/24' , ' 5.188.236.0/23' , ' 14.128.32.0/20' , ' 14.128.48.0/21' , ' 14.152.94.0/24' , ' 23.94.58.0/24' , ' 23.129.252.0/23' , ' 23.137.100.0/24' , ' 23.146.240.0/24' ...
142+
44143----
45144
46145Source Code
0 commit comments