5.14.5. Class PFService

PFServices allow you to replace the FORWARD rules of iptables, and configure application-level and packet-filter rules from Zorp.

Note

The PFService class transfers packet-filter level services.

  • To transfer connections on the packet-filter level, use the PFService class.

  • To transfer connections on the application-level, use the Service class.

Example 5.37. PFService example

The following packet-filtering service transfers TCP connections that arrive to port 5555.

PFService(name="intranet_PF5555_internet", router=TransparentRouter())

The following example defines a few Zorp classes: the client and server zones, a simple services, and a rule that starts the service.

Zone('internet', ['0.0.0.0/0'])
Zone('intranet', ['192.168.0.0/16'])

def demo() :
PFService(name="intranet_PF5555_internet", router=TransparentRouter())
Rule(dst_port=5555,
    src_zone='intranet',
    dst_zone='internet',
    service='PFService'
    )