Commit Graph

102 Commits

Author SHA1 Message Date
tschettervictor
216a4a5412 spacing 2024-12-12 19:41:52 -07:00
tschettervictor
3f97dd7e58 split options and regular case commands 2024-12-12 18:52:46 -07:00
tschettervictor
d6cbbf2ac6 quick fix 2024-12-12 18:42:52 -07:00
tschettervictor
20a291c689 add reset to help command 2024-12-12 18:40:32 -07:00
tschettervictor
ab54842061 error handling + add reset command to remove all rdr rules 2024-12-12 18:39:08 -07:00
tschettervictor
4377e1413a help message conform to case command 2024-12-12 17:25:08 -07:00
tschettervictor
7ab9188b3a Use case command instead of getopts to remain consistent 2024-12-12 17:23:21 -07:00
tschettervictor
606d8da0de only persist rdr rule if it can be properly loaded, else exit 2024-12-12 16:55:56 -07:00
tschettervictor
449a0ae8e1 add check when setting source IP + supress echo output 2024-12-12 07:41:23 -07:00
tschettervictor
492b64b302 fix help usage command 2024-12-11 18:28:10 -07:00
tschettervictor
53b47306f5 better error handling 2024-12-11 16:10:11 -07:00
tschettervictor
74eab248ca add error notify to pfctl commands/add better info commands 2024-12-11 15:56:31 -07:00
tschettervictor
8f3ad2f972 change to -ge 6 2024-12-11 12:13:05 -07:00
tschettervictor
4b5655470a add protocol to printed info 2024-12-11 11:36:10 -07:00
tschettervictor
7f1be3d480 more spacing 2024-12-11 11:06:33 -07:00
tschettervictor
f627aadac2 spacing 2024-12-11 11:06:16 -07:00
tschettervictor
d21b5166d7 add usage command with new switches 2024-12-11 11:05:47 -07:00
tschettervictor
035855bf01 major rewrite to allow setting TO+FROM 2024-12-11 10:57:07 -07:00
tschettervictor
622d84b6be allow specifying IP to redirect traffic to
This is for the folks who have multiple IP addresses on a single interface.
2024-12-10 18:45:06 -07:00
tschettervictor
eb65800a0c show output when creating rdr rule 2024-12-09 22:02:01 -07:00
tschettervictor
b16d21b018 Fix error produced by pfctl when no rules are returned 2024-12-09 20:06:28 -07:00
tschettervictor
bafa183b08 remove unecessary "echo" 2024-12-09 19:27:08 -07:00
tschettervictor
381d09592b Allow setting custom interface when doing "rdr" 2024-12-09 16:53:37 -07:00
Juan David Hurtado G
7927385458 [WIP] shellcheck linting 2024-12-08 21:34:36 -05:00
Juan David Hurtado G
11b75f5dad shellcheck errors: SC2068 Double quote array expansions to avoid re-splitting elements. 2024-11-24 20:49:06 -05:00
Juan David Hurtado G
7dbe1e761b rel: update copyright year and release version 2024-11-24 09:46:09 -05:00
Barry McCormick
f35de69b28 Merge pull request #605 from JRGTH/rdr_fixes
Add rdr pf conf check
2023-10-18 08:53:47 -07:00
Barry McCormick
3355c07dbf rdr disable directive fix 2023-10-04 10:13:08 -07:00
JRGTH
d6b5733d48 Add rdr pf conf check
Prevent shutdown/rdr command stalls.
2023-09-07 08:34:28 -04:00
Christer Edwards
15f2ea8574 Merge branch 'master' of https://github.com/bastillebsd/bastille into 2023_release 2023-07-14 21:02:30 -06:00
Christer Edwards
4efcc5021c update copyright dates 2023-07-14 21:02:14 -06:00
skenizen
373ccd45d9 changed the occurence of path /etc/pf.conf in the rdr.sh script for reading it as a variable from the bastille configuration. 2023-07-12 10:57:46 +02:00
Christer Edwards
72b8000347 fix rdr issue detecting IP6 when disabled or not set 2023-06-21 20:34:19 -06:00
android-ucet
bf6fbed2b5 add ipv6 rdr support 2023-03-28 15:03:53 +02:00
Lars Engels
64c3b6045e Allow running bastille and subcomands with help flags as regular user 2023-03-16 20:58:11 +01:00
Chris Wells
dd7f195c1e Make pf table name and external interface configurable.
Closes #508
2022-11-26 23:24:33 -05:00
Andrew Stevenson
797f406a31 Convert tab to spaces
Spaces seem to be the convention for these files, for better or worse, so make
things consistent.
2022-07-24 22:16:38 +00:00
Niketh Murali
6e5a566d7f Extend RDR to support logging
PF allows us to log rdr rules. The syntax to enable this is found in
pf.conf under the syntax grammar section for rdr-rule.

This commit extends Bastille's command line interface to allow users
to choose to log their rdr rules using the pf.conf syntax -

``````````````````````````````````````````````````````
tcp|udp host_port jail_port [log ['(' logopts ')'] ]
``````````````````````````````````````````````````````
Here, the syntax after jail_port is optional. This is sufficient to
provide backwards compatibility. The keyword 'log' enables logging with
the default options. The user can also provide custom options -
logopts - whose the syntax and allowed keywords are defined in pf.conf.
It's left to the user to supply correct logopts as the code does not
verify those values or their syntax.
2022-03-01 21:54:34 -05:00
Christer Edwards
aafc2b3323 0.9.20220216 release 2022-02-16 23:28:09 -07:00
Christer Edwards
faf3b2b691 use full path when calling jls binary 2021-12-17 19:09:49 -07:00
Daniel Ziltener
cd054f2a32 Fix for issue #403 2021-09-02 22:44:49 +02:00
Christer Edwards
74fdcbdcb5 rdr now persists rules by default; rdr.sh cleanup 2021-01-09 15:42:24 -07:00
Christer Edwards
cc870b2667 fix %s->%d regression 2021-01-05 18:24:02 -07:00
Christer Edwards
6f043d62e5 add required 'pass' to rdr rules 2021-01-05 18:00:28 -07:00
Christer Edwards
83a83e087e adding a couple vnet exceptions for ip4.addr checks 2021-01-01 09:23:26 -07:00
Chris Wells
cc513c3bed Allow port ranges in RDR parameters. 2020-11-25 20:29:15 -05:00
Chris Wells
aaffc882f9 Create and leverage global error functions 2020-08-30 10:57:14 -04:00
Marius van Witzenburg
f28054b47e Cleanup whitespace 2020-04-14 11:53:11 +02:00
Jose
01eaccc1da Add double quotes to prevent globbing/word splitting, general code consistency improvements 2020-02-20 18:06:31 -04:00
Jose
7ef65036c6 Return proper warning messages, code cleanup 2020-02-14 11:00:02 -04:00