- Timestamp:
- May 7, 2012, 8:59:45 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r10705 r10714 791 791 """ Generate configuration file '/etc/pf.hybrid.conf.local' """ 792 792 datadump['autogen_header'] = generate_header("#") 793 datadump['rdr_rules' ] = ('8081', '172.16.4.46', 'http')794 793 return Template("""\ 795 794 {{ autogen_header }} 796 795 797 796 # Redirect some internal facing services outside (7) 798 # rdr on $ext_if inet proto tcp from any to $ext_if port 8081 tag SRV -> 172.16.4.46 port http 799 # XXX: Implement 797 # INFO: {{ rdr_rules|count }} rdr_rules (outside to internal redirect rules) defined. 798 {% for src_port,dest_ip,dest_port in rdr_rules -%} 799 rdr on $ext_if inet proto tcp from any to $ext_if port {{ src_port }} tag SRV -> {{ dest_ip }} port {{ dest_port }} 800 {% endfor -%} 800 801 """).render(datadump) 801 802 … … 855 856 iface_keys = [elem for elem in datadump.keys() if elem.startswith('iface_')] 856 857 for key in sorted(set(datadump.keys()) - set(iface_keys)): 857 output += "%-10s: %s\n" % (key, format_yaml_value(datadump[key])) 858 if key == 'rdr_rules': 859 output += '%-10s:\n' % 'rdr_rules' 860 for rdr_rule in datadump[key]: 861 output += '- %s\n' % rdr_rule 862 else: 863 output += "%-10s: %s\n" % (key, format_yaml_value(datadump[key])) 858 864 859 865 output += "\n\n"
Note:
See TracChangeset
for help on using the changeset viewer.