Firehol + Fireqos Reference
Total Page:16
File Type:pdf, Size:1020Kb
FireHOL + FireQOS Reference FireHOL Team Release 2.0.0-pre7 Built 13 Apr 2014 FireHOL + FireQOS Reference Release 2.0.0-pre7 i Copyright © 2012-2014 Phil Whineray <[email protected]> Copyright © 2004, 2013-2014 Costa Tsaousis <[email protected]> FireHOL + FireQOS Reference Release 2.0.0-pre7 ii Contents 1 Introduction 1 1.1 Latest version........................................1 1.2 Who should read this manual................................1 1.3 Where to get help......................................1 1.4 Manual Organisation....................................1 1.5 Installation.........................................2 1.6 Licence...........................................2 I FireHOL3 2 Configuration 4 2.1 Getting started........................................4 2.2 Language..........................................4 2.2.1 Use of bash.....................................4 2.2.1.1 What to avoid..............................4 3 Security 6 3.1 Important Security Note..................................6 3.2 What happens when FireHOL Runs?............................6 3.3 Where to learn more....................................7 4 Troubleshooting 8 4.1 Reading log output.....................................8 FireHOL + FireQOS Reference Release 2.0.0-pre7 iii II FireQOS 11 5 Configuration 12 III FireHOL Reference 13 6 Running and Configuring 14 6.1 FireHOL program: firehol................................. 15 6.2 FireHOL configuration: firehol.conf............................ 18 6.3 control variables: firehol-variables............................. 23 6.4 ipv4/ipv6 selection: firehol-modifiers............................ 31 7 Definition Commands 33 7.1 interface definition: firehol-interface............................ 34 7.2 router definition: firehol-router............................... 36 8 Rule Subcommands 39 8.1 policy command: firehol-policy............................... 40 8.2 protection command: firehol-protection.......................... 41 8.3 server, route commands: firehol-server........................... 44 8.4 client command: firehol-client............................... 46 8.5 group command: firehol-group............................... 48 9 Optional Parameters and Actions 50 9.1 optional rule parameters: firehol-rule-params....................... 51 9.2 actions for rules: firehol-actions.............................. 57 10 Helper Commands 63 10.1 iptables helper: firehol-iptables............................... 64 10.2 masquerade helper: firehol-masquerade.......................... 65 10.3 tcpmss helper: firehol-tcpmss................................ 67 FireHOL + FireQOS Reference Release 2.0.0-pre7 iv 11 Configuration Helper Commands 68 11.1 version config helper: firehol-version............................ 69 11.2 action config helper: firehol-action............................. 70 11.3 blacklist config helper: firehol-blacklist.......................... 72 11.4 classify config helper: firehol-classify........................... 73 11.5 connmark config helper: firehol-connmark......................... 74 11.6 dscp config helper: firehol-dscp............................... 76 11.7 mac config helper: firehol-mac............................... 78 11.8 mark config helper: firehol-mark.............................. 79 11.9 nat, snat, dnat, redirect config helpers: firehol-nat..................... 81 11.10transparent_proxy, transparent_squid helpers: firehol-transparent_proxy......... 84 11.11tos config helper: firehol-tos................................ 86 11.12tosfix config helper: firehol-tosfix............................. 88 12 Services Reference 89 12.1 services list: firehol-services................................ 90 12.2 services list a: firehol-services-a.............................. 91 12.3 services list b: firehol-services-b.............................. 96 12.4 services list c: firehol-services-c.............................. 97 12.5 services list d: firehol-services-d.............................. 99 12.6 services list e: firehol-services-e.............................. 105 12.7 services list f: firehol-services-f............................... 108 12.8 services list g: firehol-services-g.............................. 110 12.9 services list h: firehol-services-h.............................. 113 12.10services list i: firehol-services-i............................... 117 12.11services list j: firehol-services-j............................... 126 12.12services list k: firehol-services-k.............................. 128 12.13services list l: firehol-services-l............................... 129 12.14services list m: firehol-services-m............................. 132 12.15services list n: firehol-services-n.............................. 136 FireHOL + FireQOS Reference Release 2.0.0-pre7 v 12.16services list o: firehol-services-o.............................. 144 12.17services list p: firehol-services-p.............................. 146 12.18services list q: firehol-services-q.............................. 150 12.19services list r: firehol-services-r............................... 151 12.20services list s: firehol-services-s.............................. 155 12.21services list t: firehol-services-t............................... 163 12.22services list u: firehol-services-u.............................. 166 12.23services list v: firehol-services-v.............................. 168 12.24services list w: firehol-services-w............................. 171 12.25services list x: firehol-services-x.............................. 173 12.26services list y: firehol-services-y.............................. 175 12.27services list z: firehol-services-z.............................. 176 IV FireQOS Reference 177 13 Running and Configuring 178 13.1 FireQOS program: fireqos................................. 179 13.2 FireQOS configuration: fireqos.conf............................ 181 14 Organising Traffic 184 14.1 interface definition: fireqos-interface............................ 185 14.2 traffic class: fireqos-class.................................. 187 14.3 traffic match: fireqos-match................................. 190 15 Optional Parameters 192 15.1 class/match parameters: fireqos-shared-params...................... 193 15.2 optional class parameters: fireqos-class-params...................... 194 15.3 optional match parameters: fireqos-match-params..................... 199 FireHOL + FireQOS Reference Release 2.0.0-pre7 vi V Appendices 203 A ICMPv6 Firewall Recommendations 204 A.1 Introduction......................................... 204 A.2 Allow outbound echo requests from prefixes which belong to the site........... 204 A.3 Allow inbound echo requests towards only predetermined hosts.............. 204 A.4 Allow incoming and outgoing echo reply messages only for existing sessions...... 205 A.5 Deny icmps to/from link local addresses.......................... 205 A.6 Drop echo replies which have a multicast address as a destination............. 205 A.7 Allow incoming destination unreachable messages only for existing sessions....... 205 A.8 Allow outgoing destination unreachable messages..................... 205 A.9 Allow incoming Packet Too Big messages only for existing sessions........... 206 A.10 Allow outgoing Packet Too Big messages......................... 206 A.11 Allow incoming time exceeded code 0 messages only for existing sessions........ 206 A.12 Allow incoming time exceeded code 1 messages...................... 206 A.13 Allow outgoing time exceeded code 0 messages...................... 206 A.14 Allow outgoing time exceeded code 1 messages...................... 206 A.15 Allow incoming parameter problem code 1 and 2 messages for an existing session.... 207 A.16 Allow outgoing parameter problem code 1 and code 2 messages............. 207 A.17 Allow incoming and outgoing parameter problem code 0 messages............ 207 A.18 Drop NS/NA messages both incoming and outgoing.................... 207 A.19 Drop RS/RA messages both incoming and outgoing.................... 207 A.20 Drop Redirect messages both incoming and outgoing................... 208 A.21 Drop incoming and outgoing Multicast Listener queries (MLDv1 and MLDv2)..... 208 A.22 Drop incoming and outgoing Multicast Listener reports (MLDv1)............ 208 A.23 Drop incoming and outgoing Multicast Listener Done messages (MLDv1)........ 209 A.24 Drop incoming and outgoing Multicast Listener reports (MLDv2)............ 209 A.25 Drop router renumbering messages............................. 209 A.26 Drop node information queries (139) and replies (140).................. 210 A.27 If there are mobile ipv6 home agents present on the trusted side allow.......... 210 A.28 If there are roaming mobile nodes present on the trusted side allow............ 210 A.29 Drop everything else.................................... 211 FireHOL + FireQOS Reference Release 2.0.0-pre7 vii 16 Index 212 FireHOL + FireQOS Reference Release 2.0.0-pre7 viii List of Tables 6.1 iptables/klogd levels.................................... 25 FireHOL + FireQOS Reference Release 2.0.0-pre7 1 / 215 Chapter 1 Introduction 1.1 Latest version The latest version of this document will always be available here. There are PDF and HTML versions. 1.2 Who should read this manual This manual is aimed at those who wish to create and maintain firewalls with FireHOL or perform traffic shaping with FireQOS. For more information and tutorials, see the FireHOL website. 1.3 Where to get help The FireHOL website. The mailing lists and archives. The package comes with a complete set of manpages, a README and a brief INSTALL guide. 1.4 Manual Organisation FireHOL, the package, consists of two principal