]>
Commit | Line | Data |
---|---|---|
b7080c8e A |
1 | .\" |
2 | .\" $Id: ipfw.8,v 1.1.1.1 2000/01/11 01:48:49 wsanchez Exp $ | |
3 | .\" | |
4 | .Dd July 20, 1996 | |
5 | .Dt IPFW 8 SMM | |
6 | .Os FreeBSD | |
7 | .Sh NAME | |
8 | .Nm ipfw | |
9 | .Nd controlling utility for IP firewall | |
10 | .Sh SYNOPSIS | |
11 | .Nm ipfw | |
12 | .Op Fl q | |
13 | .Oo | |
14 | .Fl p Ar preproc | |
15 | .Op Fl D Ar macro Ns Op Ns =value | |
16 | .Op Fl U Ar macro | |
17 | .Oc | |
18 | file | |
19 | .Nm ipfw | |
20 | .Oo | |
21 | .Fl f | |
22 | | | |
23 | .Fl q | |
24 | .Oc | |
25 | flush | |
26 | .Nm ipfw | |
27 | .Oo | |
28 | .Fl q | |
29 | .Oc | |
30 | zero | |
31 | .Op Ar number ... | |
32 | .Nm ipfw | |
33 | delete | |
34 | .Ar number ... | |
35 | .Nm ipfw | |
36 | .Op Fl aftN | |
37 | list | |
38 | .Op Ar number ... | |
39 | .Nm ipfw | |
40 | .Oo | |
41 | .Fl ftN | |
42 | .Oc | |
43 | show | |
44 | .Op Ar number ... | |
45 | .Nm ipfw | |
46 | .Oo | |
47 | .Fl q | |
48 | .Oc | |
49 | add | |
50 | .Op Ar number | |
51 | .Ar action | |
52 | .Op log | |
53 | .Ar proto | |
54 | from | |
55 | .Ar src | |
56 | to | |
57 | .Ar dst | |
58 | .Op via Ar name | ipno | |
59 | .Op Ar options | |
60 | .Sh DESCRIPTION | |
61 | If used as shown in the first synopsis line, the | |
62 | .Ar file | |
63 | will be read line by line and applied as arguments to the | |
64 | .Nm | |
65 | command. | |
66 | .Pp | |
67 | Optionally, a preprocessor can be specified using | |
68 | .Fl p Ar preproc | |
69 | where | |
70 | .Ar file | |
71 | is to be piped through. Useful preprocessors include | |
72 | .Xr cpp 1 | |
73 | and | |
74 | .Xr m4 1 . | |
75 | If | |
76 | .Ar preproc | |
77 | doesn't start with a slash as its first character, the usual | |
78 | .Ev PATH | |
79 | name search is performed. Care should be taken with this in environments | |
80 | where not all filesystems are mounted (yet) by the time | |
81 | .Nm | |
82 | is being run (e. g. since they are mounted over NFS). Once | |
83 | .Fl p | |
84 | has been specified, optional | |
85 | .Fl D | |
86 | and | |
87 | .Fl U | |
88 | specifications can follow and will be passed on to the preprocessor. | |
89 | This allows for flexible configuration files (like conditionalizing | |
90 | them on the local hostname) and the use of macros to centralize | |
91 | frequently required arguments like IP addresses. | |
92 | .Pp | |
93 | Each packet that has been received or is about to be sent goes through | |
94 | the | |
95 | .Nm | |
96 | rules. In the case of a host acting as a gateway, packets that are | |
97 | forwarded by the host are processed by | |
98 | .Nm | |
99 | twice | |
100 | .Po | |
101 | once when entering, and once when leaving | |
102 | .Pc . | |
103 | Each packet can be filtered based on the following information that is | |
104 | associated with it: | |
105 | .Pp | |
106 | .Bl -tag -offset indent -compact -width xxxx | |
107 | .It Receive Interface Pq Ar recv | |
108 | Interface over which the packet was received | |
109 | .It Transmit Interface Pq Ar xmit | |
110 | Interface over which the packet would be transmitted | |
111 | .It Incoming Pq Ar in | |
112 | Packet was just received | |
113 | .It Outgoing Pq Ar out | |
114 | Packet would be transmitted | |
115 | .It Source IP Address | |
116 | Sender's IP Address | |
117 | .It Destination IP Address | |
118 | Target's IP Address | |
119 | .It Protocol | |
120 | IP protocol, including but not limited to IP | |
121 | .Pq Ar ip , | |
122 | UDP | |
123 | .Pq Ar udp , | |
124 | TCP | |
125 | .Pq Ar tcp , | |
126 | or | |
127 | ICMP | |
128 | .Pq Ar icmp | |
129 | .It Source Port | |
130 | Sender's UDP or TCP port | |
131 | .It Destination Port | |
132 | Target's UDP or TCP port | |
133 | .It Connection Setup Flag Pq Ar setup | |
134 | This packet is a request to setup a TCP connection | |
135 | .It Connection Established Flag Pq Ar established | |
136 | This packet is part of an established TCP connection | |
137 | .It All TCP Flags Pq Ar tcpflags | |
138 | One or more of the TCP flags: close connection | |
139 | .Pq Ar fin , | |
140 | open connection | |
141 | .Pq Ar syn , | |
142 | reset connection | |
143 | .Pq Ar rst , | |
144 | push | |
145 | .Pq Ar psh , | |
146 | acknowledgment | |
147 | .Pq Ar ack , | |
148 | and | |
149 | urgent | |
150 | .Pq Ar urg | |
151 | .It Fragment Flag Pq Ar frag | |
152 | This packet is a fragment of an IP packet | |
153 | .It IP Options Pq Ar ipoptions | |
154 | One or more of the IP options: strict source route | |
155 | .Pq Ar ssrr , | |
156 | loose source route | |
157 | .Pq Ar lsrr , | |
158 | record route | |
159 | .Pq Ar rr , | |
160 | and timestamp | |
161 | .Pq Ar ts | |
162 | .It ICMP Types Pq Ar icmptypes | |
163 | One or more of the ICMP types: echo reply | |
164 | .Pq Ar 0 , | |
165 | destination unreachable | |
166 | .Pq Ar 3 , | |
167 | source quench | |
168 | .Pq Ar 4 , | |
169 | redirect | |
170 | .Pq Ar 5 , | |
171 | echo request | |
172 | .Pq Ar 8 , | |
173 | router advertisement | |
174 | .Pq Ar 9 , | |
175 | router solicitation | |
176 | .Pq Ar 10 , | |
177 | time-to-live exceeded | |
178 | .Pq Ar 11 , | |
179 | IP header bad | |
180 | .Pq Ar 12 , | |
181 | timestamp request | |
182 | .Pq Ar 13 , | |
183 | timestamp reply | |
184 | .Pq Ar 14 , | |
185 | information request | |
186 | .Pq Ar 15 , | |
187 | information reply | |
188 | .Pq Ar 16 , | |
189 | address mask request | |
190 | .Pq Ar 17 , | |
191 | and address mask reply | |
192 | .Pq Ar 18 | |
193 | .El | |
194 | .Pp | |
195 | Note that may be dangerous to filter on the source IP address or | |
196 | source TCP/UDP port because either or both could easily be spoofed. | |
197 | .Pp | |
198 | The | |
199 | .Nm | |
200 | code works by going through the rule-list for each packet | |
201 | until a match is found. | |
202 | All rules have two associated counters, a packet count and | |
203 | a byte count. | |
204 | These counters are updated when a packet matches the rule. | |
205 | .Pp | |
206 | The rules are ordered by a | |
207 | .Dq line-number | |
208 | from 1 to 65534 that is used | |
209 | to order and delete rules. Rules are tried in increasing order, and the | |
210 | first rule that matches a packet applies. | |
211 | Multiple rules may share the same number and apply in | |
212 | the order in which they were added. | |
213 | .Pp | |
214 | If a rule is added without a number, it is numbered 100 higher than the highest | |
215 | defined rule number, unless the highest defined rule number is 65435 or | |
216 | greater, in which case new rules are given that same number. | |
217 | .Pp | |
218 | The delete operation deletes the first rule with number | |
219 | .Ar number , | |
220 | if any. | |
221 | .Pp | |
222 | The list command prints out the current rule set. | |
223 | .Pp | |
224 | The show command is equivalent to | |
225 | .Sq ipfw -a list . | |
226 | .Pp | |
227 | The zero operation zeroes the counters associated with rule number | |
228 | .Ar number . | |
229 | .Pp | |
230 | The flush operation removes all rules. | |
231 | .Pp | |
232 | Any command beginning with a | |
233 | .Sq # , | |
234 | or being all blank, is ignored. | |
235 | .Pp | |
236 | One rule is always present: | |
237 | .Bd -literal -offset center | |
238 | 65535 deny all from any to any | |
239 | .Ed | |
240 | .Pp | |
241 | This rule is the default policy, i.e., don't allow anything at all. | |
242 | Your job in setting up rules is to modify this policy to match your | |
243 | needs. | |
244 | .Pp | |
245 | However, if the kernel option | |
246 | .Dq IPFIREWALL_DEFAULT_TO_ACCEPT | |
247 | is active, the rule is instead: | |
248 | .Bd -literal -offset center | |
249 | 65535 allow all from any to any | |
250 | .Ed | |
251 | .Pp | |
252 | This variation lets everything pass through. This option should only be | |
253 | activated in particular circumstances, such as if you use the firewall | |
254 | system as an on-demand denial-of-service filter that is normally wide open. | |
255 | .Pp | |
256 | The following options are available: | |
257 | .Bl -tag -width flag | |
258 | .It Fl a | |
259 | While listing, show counter values. See also | |
260 | .Dq show | |
261 | command. | |
262 | .It Fl f | |
263 | Don't ask for confirmation for commands that can cause problems if misused | |
264 | (i.e. flush). | |
265 | .Ar Note , | |
266 | if there is no tty associated with the process, this is implied. | |
267 | .It Fl q | |
268 | While adding, zeroing or flushing, be quiet about actions (implies '-f'). | |
269 | This is useful for adjusting rules by executing multiple | |
270 | .Nm | |
271 | commands in a script | |
272 | .Po | |
273 | e.g., | |
274 | .Sq sh /etc/rc.firewall | |
275 | .Pc , | |
276 | or by processing a file of many | |
277 | .Nm | |
278 | rules, | |
279 | across a remote login session. If a flush is performed in normal | |
280 | (verbose) mode (with the default kernel configuration), it prints a message. | |
281 | Because all rules are flushed, the | |
282 | message cannot be delivered to the login session. This causes the | |
283 | remote login session to be closed and the remainder of the ruleset is | |
284 | not processed. Access to the console is required to recover. | |
285 | .It Fl t | |
286 | While listing, show last match timestamp. | |
287 | .It Fl N | |
288 | Try to resolve addresses and service names in output. | |
289 | .El | |
290 | .Pp | |
291 | .Ar action : | |
292 | .Bl -hang -offset flag -width 1234567890123456 | |
293 | .It Ar allow | |
294 | Allow packets that match rule. | |
295 | The search terminates. Aliases are | |
296 | .Ar pass , | |
297 | .Ar permit , | |
298 | and | |
299 | .Ar accept . | |
300 | .It Ar deny | |
301 | Discard packets that match this rule. | |
302 | The search terminates. | |
303 | .Ar Drop | |
304 | is an alias for | |
305 | .Ar deny . | |
306 | .It Ar reject | |
307 | (Deprecated.) Discard packets that match this rule, and try to send an ICMP | |
308 | host unreachable notice. | |
309 | The search terminates. | |
310 | .It Ar unreach code | |
311 | Discard packets that match this rule, and try to send an ICMP | |
312 | unreachable notice with code | |
313 | .Ar code , | |
314 | where | |
315 | .Ar code | |
316 | is a number from zero to 255, or one of these aliases: | |
317 | .Ar net , | |
318 | .Ar host , | |
319 | .Ar protocol , | |
320 | .Ar port , | |
321 | .Ar needfrag , | |
322 | .Ar srcfail , | |
323 | .Ar net-unknown , | |
324 | .Ar host-unknown , | |
325 | .Ar isolated , | |
326 | .Ar net-prohib , | |
327 | .Ar host-prohib , | |
328 | .Ar tosnet , | |
329 | .Ar toshost , | |
330 | .Ar filter-prohib , | |
331 | .Ar host-precedence , | |
332 | or | |
333 | .Ar precedence-cutoff . | |
334 | The search terminates. | |
335 | .It Ar reset | |
336 | TCP packets only. Discard packets that match this rule, | |
337 | and try to send a TCP reset | |
338 | .Pq RST | |
339 | notice. | |
340 | The search terminates. | |
341 | .It Ar count | |
342 | Update counters for all packets that match rule. | |
343 | The search continues with the next rule. | |
344 | .It Ar divert port | |
345 | Divert packets that match this rule to the | |
346 | .Xr divert 4 | |
347 | socket bound to port | |
348 | .Ar port . | |
349 | The search terminates. | |
350 | .It Ar tee port | |
351 | Send a copy of packets matching this rule to the | |
352 | .Xr divert 4 | |
353 | socket bound to port | |
354 | .Ar port . | |
355 | The search continues with the next rule. This feature is not yet implemeted. | |
356 | .It Ar fwd ipaddr Op ,port | |
357 | Change the next-hop on matching packets to | |
358 | .Ar ipaddr , | |
359 | which can be an IP address in dotted quad or a host name. | |
360 | If | |
361 | .Ar ipaddr | |
362 | is not a directly-reachable address, the route | |
363 | as found in the local routing table for that IP is used | |
364 | instead. | |
365 | If | |
366 | .Ar ipaddr | |
367 | is a local address, then on a packet entering the system from a remote | |
368 | host it will be diverted to | |
369 | .Ar port | |
370 | on the local machine, keeping the local address of the socket set | |
371 | to the original IP address the packet was destined for. This is intended | |
372 | for use with transparent proxy servers. If the IP is not | |
373 | a local address then the port number (if specified) is ignored and | |
374 | the rule only applies to packets leaving the system. This will | |
375 | also map addresses to local ports when packets are generated locally. | |
376 | The search terminates if this rule matches. If the port number is not | |
377 | given then the port number in the packet is used, so that a packet for | |
378 | an external machine port Y would be forwarded to local port Y. The kernel | |
379 | must have been compiled with optiions IPFIREWALL_FORWARD. | |
380 | .It Ar skipto number | |
381 | Skip all subsequent rules numbered less than | |
382 | .Ar number . | |
383 | The search continues with the first rule numbered | |
384 | .Ar number | |
385 | or higher. | |
386 | .El | |
387 | .Pp | |
388 | If a packet matches more than one | |
389 | .Ar divert | |
390 | and/or | |
391 | .Ar tee | |
392 | rule, all but the last are ignored. | |
393 | .Pp | |
394 | If the kernel was compiled with | |
395 | .Dv IPFIREWALL_VERBOSE , | |
396 | then when a packet matches a rule with the | |
397 | .Ar log | |
398 | keyword a message will be printed on the console. | |
399 | If the kernel was compiled with the | |
400 | .Dv IPFIREWALL_VERBOSE_LIMIT | |
401 | option, then logging will cease after the number of packets | |
402 | specified by the option are received for that particular | |
403 | chain entry. Logging may then be re-enabled by clearing | |
404 | the packet counter for that entry. | |
405 | .Pp | |
406 | Console logging and the log limit are adjustable dynamically | |
407 | through the | |
408 | .Xr sysctl 8 | |
409 | interface. | |
410 | .Pp | |
411 | .Ar proto : | |
412 | .Bl -hang -offset flag -width 1234567890123456 | |
413 | .It Ar ip | |
414 | All packets match. The alias | |
415 | .Ar all | |
416 | has the same effect. | |
417 | .It Ar tcp | |
418 | Only TCP packets match. | |
419 | .It Ar udp | |
420 | Only UDP packets match. | |
421 | .It Ar icmp | |
422 | Only ICMP packets match. | |
423 | .It Ar <number|name> | |
424 | Only packets for the specified protocol matches (see | |
425 | .Pa /etc/protocols | |
426 | for a complete list). | |
427 | .El | |
428 | .Pp | |
429 | .Ar src | |
430 | and | |
431 | .Ar dst : | |
432 | .Bl -hang -offset flag | |
433 | .It Ar <address/mask> | |
434 | .Op Ar ports | |
435 | .El | |
436 | .Pp | |
437 | The | |
438 | .Em <address/mask> | |
439 | may be specified as: | |
440 | .Bl -hang -offset flag -width 1234567890123456 | |
441 | .It Ar ipno | |
442 | An ipnumber of the form 1.2.3.4. | |
443 | Only this exact ip number match the rule. | |
444 | .It Ar ipno/bits | |
445 | An ipnumber with a mask width of the form 1.2.3.4/24. | |
446 | In this case all ip numbers from 1.2.3.0 to 1.2.3.255 will match. | |
447 | .It Ar ipno:mask | |
448 | An ipnumber with a mask width of the form 1.2.3.4:255.255.240.0. | |
449 | In this case all ip numbers from 1.2.0.0 to 1.2.15.255 will match. | |
450 | .El | |
451 | .Pp | |
452 | The sense of the match can be inverted by preceding an address with the | |
453 | .Dq not | |
454 | modifier, causing all other addresses to be matched instead. This | |
455 | does not affect the selection of port numbers. | |
456 | .Pp | |
457 | With the TCP and UDP protocols, optional | |
458 | .Em ports | |
459 | may be specified as: | |
460 | .Pp | |
461 | .Bl -hang -offset flag | |
462 | .It Ns {port|port-port} Ns Op ,port Ns Op ,... | |
463 | .El | |
464 | .Pp | |
465 | Service names (from | |
466 | .Pa /etc/services ) | |
467 | may be used instead of numeric port values. | |
468 | A range may only be specified as the first value, | |
469 | and the length of the port list is limited to | |
470 | .Dv IP_FW_MAX_PORTS | |
471 | (as defined in | |
472 | .Pa /usr/src/sys/netinet/ip_fw.h ) | |
473 | ports. | |
474 | .Pp | |
475 | Fragmented packets which have a non-zero offset (i.e. not the first | |
476 | fragment) will never match a rule which has one or more port | |
477 | specifications. See the | |
478 | .Ar frag | |
479 | option for details on matching fragmented packets. | |
480 | .Pp | |
481 | Rules can apply to packets when they are incoming, or outgoing, or both. | |
482 | The | |
483 | .Ar in | |
484 | keyword indicates the rule should only match incoming packets. | |
485 | The | |
486 | .Ar out | |
487 | keyword indicates the rule should only match outgoing packets. | |
488 | .Pp | |
489 | To match packets going through a certain interface, specify | |
490 | the interface using | |
491 | .Ar via : | |
492 | .Bl -hang -offset flag -width 1234567890123456 | |
493 | .It Ar via ifX | |
494 | Packet must be going through interface | |
495 | .Ar ifX. | |
496 | .It Ar via if* | |
497 | Packet must be going through interface | |
498 | .Ar ifX , | |
499 | where X is any unit number. | |
500 | .It Ar via any | |
501 | Packet must be going through | |
502 | .Em some | |
503 | interface. | |
504 | .It Ar via ipno | |
505 | Packet must be going through the interface having IP address | |
506 | .Ar ipno . | |
507 | .El | |
508 | .Pp | |
509 | The | |
510 | .Ar via | |
511 | keyword causes the interface to always be checked. | |
512 | If | |
513 | .Ar recv | |
514 | or | |
515 | .Ar xmit | |
516 | is used instead of | |
517 | .Ar via , | |
518 | then the only receive or transmit interface (respectively) is checked. | |
519 | By specifying both, it is possible to match packets based on both receive | |
520 | and transmit interface, e.g.: | |
521 | .Pp | |
522 | .Dl "ipfw add 100 deny ip from any to any out recv ed0 xmit ed1" | |
523 | .Pp | |
524 | The | |
525 | .Ar recv | |
526 | interface can be tested on either incoming or outgoing packets, while the | |
527 | .Ar xmit | |
528 | interface can only be tested on outgoing packets. So | |
529 | .Ar out | |
530 | is required (and | |
531 | .Ar in | |
532 | invalid) whenver | |
533 | .Ar xmit | |
534 | is used. Specifying | |
535 | .Ar via | |
536 | together with | |
537 | .Ar xmit | |
538 | or | |
539 | .Ar recv | |
540 | is invalid. | |
541 | .Pp | |
542 | A packet may not have a receive or transmit interface: packets originating | |
543 | from the local host have no receive interface. while packets destined for | |
544 | the local host have no transmit interface. | |
545 | .Pp | |
546 | Additional | |
547 | .Ar options : | |
548 | .Bl -hang -offset flag -width 1234567890123456 | |
549 | .It frag | |
550 | Matches if the packet is a fragment and this is not the first fragment | |
551 | of the datagram. | |
552 | .Ar frag | |
553 | may not be used in conjunction with either | |
554 | .Ar tcpflags | |
555 | or TCP/UDP port specifications. | |
556 | .It in | |
557 | Matches if this packet was on the way in. | |
558 | .It out | |
559 | Matches if this packet was on the way out. | |
560 | .It ipoptions Ar spec | |
561 | Matches if the IP header contains the comma separated list of | |
562 | options specified in | |
563 | .Ar spec . | |
564 | The supported IP options are: | |
565 | .Ar ssrr | |
566 | (strict source route), | |
567 | .Ar lsrr | |
568 | (loose source route), | |
569 | .Ar rr | |
570 | (record packet route), and | |
571 | .Ar ts | |
572 | (timestamp). | |
573 | The absence of a particular option may be denoted | |
574 | with a | |
575 | .Dq ! . | |
576 | .It established | |
577 | Matches packets that have the RST or ACK bits set. | |
578 | TCP packets only. | |
579 | .It setup | |
580 | Matches packets that have the SYN bit set but no ACK bit. | |
581 | TCP packets only. | |
582 | .It tcpflags Ar spec | |
583 | Matches if the TCP header contains the comma separated list of | |
584 | flags specified in | |
585 | .Ar spec . | |
586 | The supported TCP flags are: | |
587 | .Ar fin , | |
588 | .Ar syn , | |
589 | .Ar rst , | |
590 | .Ar psh , | |
591 | .Ar ack , | |
592 | and | |
593 | .Ar urg . | |
594 | The absence of a particular flag may be denoted | |
595 | with a | |
596 | .Dq ! . | |
597 | A rule which contains a | |
598 | .Ar tcpflags | |
599 | specification can never match a fragmented packet which has | |
600 | a non-zero offset. See the | |
601 | .Ar frag | |
602 | option for details on matching fragmented packets. | |
603 | .It icmptypes Ar types | |
604 | Matches if the ICMP type is in the list | |
605 | .Ar types . | |
606 | The list may be specified as any combination of ranges | |
607 | or individual types separated by commas. | |
608 | .El | |
609 | .Sh CHECKLIST | |
610 | Here are some important points to consider when designing your | |
611 | rules: | |
612 | .Bl -bullet -hang -offset flag | |
613 | .It | |
614 | Remember that you filter both packets going in and out. | |
615 | Most connections need packets going in both directions. | |
616 | .It | |
617 | Remember to test very carefully. | |
618 | It is a good idea to be near the console when doing this. | |
619 | .It | |
620 | Don't forget the loopback interface. | |
621 | .El | |
622 | .Sh FINE POINTS | |
623 | There is one kind of packet that the firewall will always discard, | |
624 | that is an IP fragment with a fragment offset of one. | |
625 | This is a valid packet, but it only has one use, to try to circumvent | |
626 | firewalls. | |
627 | .Pp | |
628 | If you are logged in over a network, loading the KLD version of | |
629 | .Nm | |
630 | is probably not as straightforward as you would think. | |
631 | I recommend this command line: | |
632 | .Bd -literal -offset center | |
633 | kldload /modules/ipfw.ko && \e | |
634 | ipfw add 32000 allow all from any to any | |
635 | .Ed | |
636 | .Pp | |
637 | Along the same lines, doing an | |
638 | .Bd -literal -offset center | |
639 | ipfw flush | |
640 | .Ed | |
641 | .Pp | |
642 | in similar surroundings is also a bad idea. | |
643 | .Pp | |
644 | The IP filter list may not be modified if the system security level | |
645 | is set to 3 or higher | |
646 | .Po | |
647 | see | |
648 | .Xr init 8 | |
649 | for information on system security levels | |
650 | .Pc . | |
651 | .Sh PACKET DIVERSION | |
652 | A divert socket bound to the specified port will receive all packets diverted | |
653 | to that port; see | |
654 | .Xr divert 4 . | |
655 | If no socket is bound to the destination port, or if the kernel | |
656 | wasn't compiled with divert socket support, diverted packets are dropped. | |
657 | .Sh EXAMPLES | |
658 | This command adds an entry which denies all tcp packets from | |
659 | .Em cracker.evil.org | |
660 | to the telnet port of | |
661 | .Em wolf.tambov.su | |
662 | from being forwarded by the host: | |
663 | .Pp | |
664 | .Dl ipfw add deny tcp from cracker.evil.org to wolf.tambov.su 23 | |
665 | .Pp | |
666 | This one disallows any connection from the entire crackers network to | |
667 | my host: | |
668 | .Pp | |
669 | .Dl ipfw add deny all from 123.45.67.0/24 to my.host.org | |
670 | .Pp | |
671 | Here is a good usage of the | |
672 | .Ar list | |
673 | command to see accounting records | |
674 | and timestamp information: | |
675 | .Pp | |
676 | .Dl ipfw -at l | |
677 | .Pp | |
678 | or in short form without timestamps: | |
679 | .Pp | |
680 | .Dl ipfw -a l | |
681 | .Pp | |
682 | This rule diverts all incoming packets from 192.168.2.0/24 to divert port 5000: | |
683 | .Pp | |
684 | .Dl ipfw divert 5000 all from 192.168.2.0/24 to any in | |
685 | .Sh SEE ALSO | |
686 | .Xr cpp 1 , | |
687 | .Xr m4 1 , | |
688 | .Xr divert 4 , | |
689 | .Xr ip 4 , | |
690 | .Xr ipfirewall 4 , | |
691 | .Xr protocols 5 , | |
692 | .Xr services 5 , | |
693 | .Xr init 8 , | |
694 | .Xr kldload 8 , | |
695 | .Xr reboot 8 , | |
696 | .Xr sysctl 8 , | |
697 | .Xr syslogd 8 . | |
698 | .Sh BUGS | |
699 | .Pp | |
700 | .Em WARNING!!WARNING!!WARNING!!WARNING!!WARNING!!WARNING!!WARNING!! | |
701 | .Pp | |
702 | This program can put your computer in rather unusable state. When | |
703 | using it for the first time, work on the console of the computer, and | |
704 | do | |
705 | .Em NOT | |
706 | do anything you don't understand. | |
707 | .Pp | |
708 | When manipulating/adding chain entries, service and protocol names are | |
709 | not accepted. | |
710 | .Pp | |
711 | Incoming packet fragments diverted by | |
712 | .Ar divert | |
713 | are reassembled before delivery to the socket, whereas fragments diverted via | |
714 | .Ar tee | |
715 | are not. | |
716 | .Pp | |
717 | Port aliases containing dashes cannot be first in a list. | |
718 | .Pp | |
719 | The | |
720 | .Dq tee | |
721 | action is unimplemented. | |
722 | .Sh AUTHORS | |
723 | .An Ugen J. S. Antsilevich , | |
724 | .An Poul-Henning Kamp , | |
725 | .An Alex Nash , | |
726 | .An Archie Cobbs . | |
727 | API based upon code written by | |
728 | .An Daniel Boulet | |
729 | for BSDI. | |
730 | .Sh HISTORY | |
731 | .Nm | |
732 | first appeared in | |
733 | .Fx 2.0 . |