MirredAction

The MirredAction supports packet mirroring and packet rediection.

class MirredAction(action_index: Optional[int] = None, *, mirred_action: str, direction: str, to_dev: str)[source]

This class supports the tc(8) mirred action as documented in tc-mirred(8).

Parameters:
  • action_index – an integer that effectively names the action

  • mirred_action – either mirror or redirect

  • direction – either ingress or egress

  • to_dev – destination interface

MIRROR = 'mirror'

mirred mirroring action

REDIRECT = 'redirect'

mirred redirect action

EGRESS = 'egress'

Direction for packets to be sent out

INGRESS = 'ingress'

Direction for packets to be received

get_destination_interface() str[source]

Returns the name of the destination interface

get_mirred_action() str[source]

Returns the mirred action, either MirredAction.MIRROR or MirredAction.REDIRECT

get_direction() Optional[int][source]

Returns the direction of the packet when it arrives at the destination interface, either MirredAction.INGRESS or MirredAction.EGRESS

action_creation_args() List[str][source]

Returns a list of tc(8) arguments to create this filter

get_action_index() Optional[int]

Returns the action index

get_kind() str

Returns the action type