fireqos-match

title: fireqos-match(5)

summary: shared class/match parameters

text:
# fireqos-match(5)

## NAME
fireqos-params - shared class/match parameters

## SYNOPSIS
prio

priority

## DESCRIPTION
Some optional parameter names are the same for both class and match. This page exists as a placeholder to help you find the appropriate documentation.

If you are searching for FireQOS parameters in general, see both fireqos-params-class(5) and/or fireqos-params-match(5) depending upon your need.

prio

For the class version, see fireqos-params-class(5).

For the match version, see fireqos-params-match(5).

priority

For the class version, see fireqos-params-match(5).

For the match version, see fireqos-params-class(5).

## SEE ALSO
•

fireqos-params-class(5) - QOS class parameters

•

fireqos-params-match(5) - QOS match parameters

•

FireHOL Website (http://firehol.org/)

•

FireQOS Online PDF Manual (http://firehol.org/fireqos-manual.pdf)

•

FireQOS Online Documentation (http://firehol.org/documentation/)

## AUTHORS
FireHOL Team.


fireqos-params

package: firehol

title: fireqos-params(5)

summary: shared class/match parameters

text:
# fireqos-params(5)

## NAME
fireqos-params - shared class/match parameters

## SYNOPSIS
prio

priority

## DESCRIPTION
Some optional parameter names are the same for both class and match. This page exists as a placeholder to help you find the appropriate documentation.

If you are searching for FireQOS parameters in general, see both fireqos-params-class(5) and/or fireqos-params-match(5) depending upon your need.

prio

For the class version, see fireqos-params-class(5).

For the match version, see fireqos-params-match(5).

priority

For the class version, see fireqos-params-match(5).

For the match version, see fireqos-params-class(5).

## SEE ALSO
•

fireqos-params-class(5) - QOS class parameters

•

fireqos-params-match(5) - QOS match parameters

•

FireHOL Website (http://firehol.org/)

•

FireQOS Online PDF Manual (http://firehol.org/fireqos-manual.pdf)

•

FireQOS Online Documentation (http://firehol.org/documentation/)

## AUTHORS
FireHOL Team.


fireqos-params-class

title: fireqos-params-class(5)

summary: optional class parameters

text:
# fireqos-params-class(5)

## NAME
fireqos-params-class - optional class parameters

## SYNOPSIS
rate | commit | min speed

ceil | max speed

minrate speed

{ qdisc qdisc-name | pfifo|bfifo|sfq|fq_codel|codel|none } [options "qdisc-options"]

prio { 0..7 | keep | last }

{ linklayer linklayer-name } | { adsl {local|remote} encapsulation } | ethernet | atm

mtu bytes

mpu bytes

tsize size

overhead bytes

r2q factor

burst bytes

cburst bytes

quantum bytes

priority | balanced

input | output

## DESCRIPTION
All of the options apply to interface and class statements.

Units for speeds are defined in fireqos.conf(5).

### input, output
For bidirectional interfaces, input and output define the direction for which the parameters following it are applied.

Only the following parameters are affected (all the others are applied to both input and output):

•

minrate

•

rate, min, commit

•

ceil, max

If one of the above is not defined for either input or output, its default will be used.

### rate, commit, min
When a committed rate of speed is provided to a class, it means that the bandwidth will be given to the class when it needs it. If the class does not need the bandwidth, it will be available for any other class to use.

For interfaces, a rate must be defined.

For classes the rate defaults to 1/100 of the interface capacity.

## ceil, max
Defines the maximum speed a class can use. Even there is available bandwidth, a class will not exceed its ceil speed.

For interfaces, the default is the rate speed of the interface.

For classes, the defaults is the ceil of the their interfaces.

### minrate
Defines the default committed speed for all classes not specifically given a rate in the config file. It forces a recalculation of tc(8) r2q.

When minrate is not given, FireQOS assigns a default value of 1/100 of the interface rate.

### qdisc qdisc-name, pfifo, bfifo, sfq, fq_codel, codel, none
The qdisc defines the method to distribute class bandwidth to its sockets. It is applied within the class itself and is useful in cases where a class gets saturated. For information about these, see the Traffic Control Howto (http://www.tldp.org/HOWTO/Traffic-Control-HOWTO/classless-qdiscs.html)

A qdisc is only useful when applied to a class. It can be specified at the interface level in order to set the default for all of the included classes.

To pass options to a qdisc, you can specify them through an environment variable or explicitly on each class.

Set the variable FIREQOS_DEFAULT_QDISC_OPTIONS_qdiscname in the config file. For example, for sfq:

```
FIREQOS_DEFAULT_QDISC_OPTIONS_sfq="perturb 10 quantum 2000".
```

Using this variable each sfq will get these options by default. You can still override this by specifying explicit options for individual qdiscs, for example to add some sfq options you would write:

```
class classname sfq options "perturb 10 quantum 2000"
```

The options keyword must appear just after the qdisc name.

### prio (class)
Note

There is also a match parameter called prio, see fireqos-params-match(5).

HTB supports 8 priorities, from 0 to 7. Any number less than 0 will give priority 0. Any number above 7 will give priority 7.

By default, FireQOS gives the first class priority 0, and increases this number by 1 for each class it encounters in the config file. If there are more than 8 classes, all classes after the 8th will get priority 7. In balanced mode (see balanced, below), all classes will get priority 4 by default.

FireQOS restarts priorities for each interface and class group.

The class priority defines how the spare bandwidth is spread among the classes. Classes with higher priorities (lower prio) will get all spare bandwidth. Classes with the same priority will get a percentage of the spare bandwidth, proportional to their committed rates.

The keywords keep and last will make a class use the priority of the class just above / before it. So to make two consecutive classes have the same prio, just add prio keep to the second one.

### linklayer linklayer-name, ethernet, atm
The linklayer can only be given on interfaces. It is used by the kernel to calculate the overheads in the packets.

### adsl
adsl is a special linklayer that automatically calculates ATM overheads for the link.

local is used when linux is running PPPoE.

remote is used when PPPoE is running on the router.

Note

This special case has not yet been demonstrated for sure. Experiment a bit and if you find out, let us know to update this page. In practice, this parameter lets the kernel know that the packets it sees, have already an ethernet header on them.

encapsulation can be one of (all the labels on the same line are aliases):

•

IPoA-VC/Mux or ipoa-vcmux or ipoa-vc or ipoa-mux,

•

IPoA-LLC/SNAP or ipoa-llcsnap or ipoa-llc or ipoa-snap

•

Bridged-VC/Mux or bridged-vcmux or bridged-vc or bridged-mux

•

Bridged-LLC/SNAP or bridged-llcsnap or bridged-llc or bridged-snap

•

PPPoA-VC/Mux or pppoa-vcmux or pppoa-vc or pppoa-mux

•

PPPoA-LLC/SNAP or pppoa-llcsnap or pppoa-llc or pppoa-snap

•

PPPoE-VC/Mux or pppoe-vcmux or pppoe-vc or pppoe-mux

•

PPPoE-LLC/SNAP or pppoe-llcsnap or pppoe-llc or pppoe-snap

If your adsl router can give you the mtu, it would be nice to add an mtu parameter too. For detailed info, see here (http://ace-host.stuart.id.au/russell/files/tc/tc-atm/).

### mtu
Defines the MTU of the interface in bytes.

FireQOS will query the interface to find its MTU. You can overwrite this behaviour by giving this parameter to a class or interface.

### mpu
Defines the MPU of the interface in bytes.

FireQOS does not set a default value. You can set your own using this parameter.

### tsize
FireQOS does not set a default size. You can set your own using this parameter.

### overhead
FireQOS automatically calculates the bytes overhead for ADSL. For all other technologies, you can specify the overhead in the config file.

### r2q
FireQOS calculates the proper r2q factor, so that you can control speeds in steps of 1/100th of the interface speed (if that is possible).

Note

The HTB manual states that this parameter is ignored when a quantum have been set. By default, FireQOS sets quantum to interface MTU, so r2q is probably is ignored by the kernel.

### burst
burst specifies the number of bytes that will be sent at once, at ceiling speed, when a class is allowed to send traffic. It is like a 'traffic unit'. A class is allowed to send at least burst bytes before trying to serve any other class.

burst should never be lower that the interface mtu and class groups and interfaces should never have a smaller burst value than their children. If you do specify a higher burst for a child class, its parent may get stuck sometimes (the child will drain the parent).

By default, FireQOS lets the kernel decide this parameter, which calculates the lowest possible value (the minimum value depends on the rate of the interface and the clock speed of the CPU).

burst is inherited from interfaces to classes and from group classes to their subclasses. FireQOS will not allow you to set a burst at a subclass, higher than its parent. Setting a burst of a subclass higher than its parent will drain the parent class, which may be stuck for up to a minute when this happens. For this check to work, FireQOS uses just its configuration (it does not query the kernel to check how the value specified in the config file for a subclass relates to the actual value of its parent).

### cburst
cburst is like burst, but at hardware speed (not just ceiling speed).

By default, FireQOS lets the kernel decide this parameter.

cburst is inherited from interfaces to classes and from group classes to their subclasses. FireQOS will not allow you to set a cburst at a subclass, higher to its parent. Setting a cburst of a subclass higher than its parent, will drain the parent class, which may be stuck for up to a minute when this happens. For this check to work, FireQOS uses just its configuration (it does not query the kernel to check how the value specified in the config file for a subclass relates to the actual value of its parent).

### quantum
quantum specifies the number of bytes a class is allowed to send at once, when it is borrowing spare bandwidth from other classes.

By default, FireQOS sets quantum to the interface mtu.

quantum is inherited from interfaces to classes and from group classes to their subclasses.

### priority, balanced
These parameters set the priority mode of the child classes.

priority

priority is the default mode, where FireQOS assigns an incremental priority to each class. In this mode, the first class takes prio 0, the second prio 1, etc. When a class has a higher prio than the others (higher = smaller number), this high priority class will get all the spare bandwidth available, when it needs it. Spare bandwidth will be allocate to lower priority classes only when the higher priority ones do not need it.

balanced

balanced mode gives prio 4 to all child classes. When multiple classes have the same prio, the spare bandwidth available is spread among them, proportionally to their committed rate. The value 4 can be overwritten by setting FIREQOS_BALANCED_PRIO at the top of the config file to the prio you want the balanced mode to assign for all classes.

The priority mode can be set in interfaces and class groups. The effect is the same. The classes that are defined as child classes, will get by default the calculated class prio based on the priority mode given.

These options affect only the default prio that will be assigned by FireQOS. The default is used only if you don't explicitly use a prio parameter on a class.

Note

There is also a match parameter called priority, see fireqos-params-match(5).

## SEE ALSO
•

fireqos(1) - FireQOS program

•

fireqos.conf(5) - FireQOS configuration file

•

fireqos-interface(5) - QOS interface definition

•

fireqos-class(5) - QOS class definition

•

FireHOL Website (http://firehol.org/)

•

FireQOS Online PDF Manual (http://firehol.org/fireqos-manual.pdf)

•

FireQOS Online Documentation (http://firehol.org/documentation/)

## AUTHORS
FireHOL Team.


fireqos-params-match

title: fireqos-params-match(5)

summary: optional class parameters

text:
# fireqos-params-match(5)

## NAME
fireqos-params-class - optional class parameters

## SYNOPSIS
rate | commit | min speed

ceil | max speed

minrate speed

{ qdisc qdisc-name | pfifo|bfifo|sfq|fq_codel|codel|none } [options "qdisc-options"]

prio { 0..7 | keep | last }

{ linklayer linklayer-name } | { adsl {local|remote} encapsulation } | ethernet | atm

mtu bytes

mpu bytes

tsize size

overhead bytes

r2q factor

burst bytes

cburst bytes

quantum bytes

priority | balanced

input | output

## DESCRIPTION
All of the options apply to interface and class statements.

Units for speeds are defined in fireqos.conf(5).

### input, output
For bidirectional interfaces, input and output define the direction for which the parameters following it are applied.

Only the following parameters are affected (all the others are applied to both input and output):

•

minrate

•

rate, min, commit

•

ceil, max

If one of the above is not defined for either input or output, its default will be used.

### rate, commit, min
When a committed rate of speed is provided to a class, it means that the bandwidth will be given to the class when it needs it. If the class does not need the bandwidth, it will be available for any other class to use.

For interfaces, a rate must be defined.

For classes the rate defaults to 1/100 of the interface capacity.

## ceil, max
Defines the maximum speed a class can use. Even there is available bandwidth, a class will not exceed its ceil speed.

For interfaces, the default is the rate speed of the interface.

For classes, the defaults is the ceil of the their interfaces.

### minrate
Defines the default committed speed for all classes not specifically given a rate in the config file. It forces a recalculation of tc(8) r2q.

When minrate is not given, FireQOS assigns a default value of 1/100 of the interface rate.

### qdisc qdisc-name, pfifo, bfifo, sfq, fq_codel, codel, none
The qdisc defines the method to distribute class bandwidth to its sockets. It is applied within the class itself and is useful in cases where a class gets saturated. For information about these, see the Traffic Control Howto (http://www.tldp.org/HOWTO/Traffic-Control-HOWTO/classless-qdiscs.html)

A qdisc is only useful when applied to a class. It can be specified at the interface level in order to set the default for all of the included classes.

To pass options to a qdisc, you can specify them through an environment variable or explicitly on each class.

Set the variable FIREQOS_DEFAULT_QDISC_OPTIONS_qdiscname in the config file. For example, for sfq:

```
FIREQOS_DEFAULT_QDISC_OPTIONS_sfq="perturb 10 quantum 2000".
```

Using this variable each sfq will get these options by default. You can still override this by specifying explicit options for individual qdiscs, for example to add some sfq options you would write:

```
class classname sfq options "perturb 10 quantum 2000"
```

The options keyword must appear just after the qdisc name.

### prio (class)
Note

There is also a match parameter called prio, see fireqos-params-match(5).

HTB supports 8 priorities, from 0 to 7. Any number less than 0 will give priority 0. Any number above 7 will give priority 7.

By default, FireQOS gives the first class priority 0, and increases this number by 1 for each class it encounters in the config file. If there are more than 8 classes, all classes after the 8th will get priority 7. In balanced mode (see balanced, below), all classes will get priority 4 by default.

FireQOS restarts priorities for each interface and class group.

The class priority defines how the spare bandwidth is spread among the classes. Classes with higher priorities (lower prio) will get all spare bandwidth. Classes with the same priority will get a percentage of the spare bandwidth, proportional to their committed rates.

The keywords keep and last will make a class use the priority of the class just above / before it. So to make two consecutive classes have the same prio, just add prio keep to the second one.

### linklayer linklayer-name, ethernet, atm
The linklayer can only be given on interfaces. It is used by the kernel to calculate the overheads in the packets.

### adsl
adsl is a special linklayer that automatically calculates ATM overheads for the link.

local is used when linux is running PPPoE.

remote is used when PPPoE is running on the router.

Note

This special case has not yet been demonstrated for sure. Experiment a bit and if you find out, let us know to update this page. In practice, this parameter lets the kernel know that the packets it sees, have already an ethernet header on them.

encapsulation can be one of (all the labels on the same line are aliases):

•

IPoA-VC/Mux or ipoa-vcmux or ipoa-vc or ipoa-mux,

•

IPoA-LLC/SNAP or ipoa-llcsnap or ipoa-llc or ipoa-snap

•

Bridged-VC/Mux or bridged-vcmux or bridged-vc or bridged-mux

•

Bridged-LLC/SNAP or bridged-llcsnap or bridged-llc or bridged-snap

•

PPPoA-VC/Mux or pppoa-vcmux or pppoa-vc or pppoa-mux

•

PPPoA-LLC/SNAP or pppoa-llcsnap or pppoa-llc or pppoa-snap

•

PPPoE-VC/Mux or pppoe-vcmux or pppoe-vc or pppoe-mux

•

PPPoE-LLC/SNAP or pppoe-llcsnap or pppoe-llc or pppoe-snap

If your adsl router can give you the mtu, it would be nice to add an mtu parameter too. For detailed info, see here (http://ace-host.stuart.id.au/russell/files/tc/tc-atm/).

### mtu
Defines the MTU of the interface in bytes.

FireQOS will query the interface to find its MTU. You can overwrite this behaviour by giving this parameter to a class or interface.

### mpu
Defines the MPU of the interface in bytes.

FireQOS does not set a default value. You can set your own using this parameter.

### tsize
FireQOS does not set a default size. You can set your own using this parameter.

### overhead
FireQOS automatically calculates the bytes overhead for ADSL. For all other technologies, you can specify the overhead in the config file.

### r2q
FireQOS calculates the proper r2q factor, so that you can control speeds in steps of 1/100th of the interface speed (if that is possible).

Note

The HTB manual states that this parameter is ignored when a quantum have been set. By default, FireQOS sets quantum to interface MTU, so r2q is probably is ignored by the kernel.

### burst
burst specifies the number of bytes that will be sent at once, at ceiling speed, when a class is allowed to send traffic. It is like a 'traffic unit'. A class is allowed to send at least burst bytes before trying to serve any other class.

burst should never be lower that the interface mtu and class groups and interfaces should never have a smaller burst value than their children. If you do specify a higher burst for a child class, its parent may get stuck sometimes (the child will drain the parent).

By default, FireQOS lets the kernel decide this parameter, which calculates the lowest possible value (the minimum value depends on the rate of the interface and the clock speed of the CPU).

burst is inherited from interfaces to classes and from group classes to their subclasses. FireQOS will not allow you to set a burst at a subclass, higher than its parent. Setting a burst of a subclass higher than its parent will drain the parent class, which may be stuck for up to a minute when this happens. For this check to work, FireQOS uses just its configuration (it does not query the kernel to check how the value specified in the config file for a subclass relates to the actual value of its parent).

### cburst
cburst is like burst, but at hardware speed (not just ceiling speed).

By default, FireQOS lets the kernel decide this parameter.

cburst is inherited from interfaces to classes and from group classes to their subclasses. FireQOS will not allow you to set a cburst at a subclass, higher to its parent. Setting a cburst of a subclass higher than its parent, will drain the parent class, which may be stuck for up to a minute when this happens. For this check to work, FireQOS uses just its configuration (it does not query the kernel to check how the value specified in the config file for a subclass relates to the actual value of its parent).

### quantum
quantum specifies the number of bytes a class is allowed to send at once, when it is borrowing spare bandwidth from other classes.

By default, FireQOS sets quantum to the interface mtu.

quantum is inherited from interfaces to classes and from group classes to their subclasses.

### priority, balanced
These parameters set the priority mode of the child classes.

priority

priority is the default mode, where FireQOS assigns an incremental priority to each class. In this mode, the first class takes prio 0, the second prio 1, etc. When a class has a higher prio than the others (higher = smaller number), this high priority class will get all the spare bandwidth available, when it needs it. Spare bandwidth will be allocate to lower priority classes only when the higher priority ones do not need it.

balanced

balanced mode gives prio 4 to all child classes. When multiple classes have the same prio, the spare bandwidth available is spread among them, proportionally to their committed rate. The value 4 can be overwritten by setting FIREQOS_BALANCED_PRIO at the top of the config file to the prio you want the balanced mode to assign for all classes.

The priority mode can be set in interfaces and class groups. The effect is the same. The classes that are defined as child classes, will get by default the calculated class prio based on the priority mode given.

These options affect only the default prio that will be assigned by FireQOS. The default is used only if you don't explicitly use a prio parameter on a class.

Note

There is also a match parameter called priority, see fireqos-params-match(5).

## SEE ALSO
•

fireqos(1) - FireQOS program

•

fireqos.conf(5) - FireQOS configuration file

•

fireqos-interface(5) - QOS interface definition

•

fireqos-class(5) - QOS class definition

•

FireHOL Website (http://firehol.org/)

•

FireQOS Online PDF Manual (http://firehol.org/fireqos-manual.pdf)

•

FireQOS Online Documentation (http://firehol.org/documentation/)

## AUTHORS
FireHOL Team.


vnetbuild-conf

title: vnetbuild-conf(5)

text:
# vnetbuild-conf(5)

## NAME
vnetbuild - an easy to use but powerful namespace setup tool

## SYNOPSIS
sudo vnetbuild CONFIGFILE { start | stop | status }

vnetbuild CONFIGFILE graphviz OUTFILE.{gv|png|pdf|ps}

## DESCRIPTION
VNetBuild is a program that helps you set up groups of interconnected network namespaces, to simulate networks of any complexity without resorting to using real or virtual machines.

This is ideal for testing complex multi-host configurations with a minimal amount of resources on a single machine:

•

Each namespace can have its own network setup, including firewall and QOS configuration.

•

Commands can be run in the namespace and will have that specific view of the network, including running standard network tools and daemons.

Run without any arguments, vnetbuild will present some help on usage.

## COMMANDS
start

Sets up a series of network namespaces as defined in CONFIGFILE. vnetbuild creates interconnected network devices as specified in the configuration, sets up routing and runs any custom commands that are given within the namespace.

stop

Removes any devices from the namespaces defined in CONFIGFILE and kills any processes running with the namespaces, then removes the namespaces themselves.

status

For each namespace defined in CONFIGFILE, shows if it is active and if so its network devices and their configuration.

graphviz OUTFILE

Generates a graph of the network defined in CONFIGFILE. This does not need root access, nor does it require the namespaces to have been started.

OUTFILE can be png pdf or ps. If the extension gv is given the output is a graphviz(7) file which you can process separately.

## RUNNING COMMANDS IN A NAMESPACE
Once you have created a set of network namespaces, you can easily run any commands you want within them. If for instance you defined three hosts (host_a with IP 10.0.0.1, host_b with IP 10.0.0.2 and host_c with IP 10.0.0.3) connected via a common switch sw0:

```
 # ping host_b and host_c from host_a
 sudo ip netns exec host_a ping 10.0.0.2
 sudo ip netns exec host_a ping 10.0.0.3
 # use netcat to listen on host_a and send data from host_b
 # (use two terminals to run the commands simultaneously)
 sudo ip netns exec host_a nc -l -p 23
 sudo ip netns exec host_b nc -q 0 10.0.0.1 23 < /etc/hosts
 # capture traffic passing through the switch, then view it
 sudo ip netns exec sw0 tcpdump -i switch -w capfile
 wireshark capfile
 # Use 'firehol panic' in host_b to block all traffic
 # (you could equally load a full config etc.)
 sudo ip netns exec host_b firehol panic
 # this is now blocked
 sudo ip netns exec host_a ping 10.0.0.2
 # not blocked (host_b not involved)
 sudo ip netns exec host_a ping 10.0.0.3
 # obtain a shell for your regular user, only "in" host_c
 sudo ip netns exec host_c sudo -i -u $USER
 ip a | grep 10.0.0.3
```

## SEE ALSO
•

vnetbuild.conf(5) - VNetBuild configuration file

•

firehol(1) - FireHOL program

•

fireqos(1) - FireQOS program

•

FireHOL Website (http://firehol.org/)

•

VNetBuild Online PDF Manual (http://firehol.org/vnetbuild-manual.pdf)

•

VNetBuild Online Documentation (http://firehol.org/documentation/) 8 192.168.1.2/24 host b dev vppp0 a/veth0 10.0.0.2/8 192.168.1.3/24 ````

A dev may not specify an IP address if it is in a switch. Switches exist just to tie together multiple devices in hosts, just like a physical network switch.

bridgedev BRIDGE ...

Define an ethernet bridge, BRIDGE in a host. These are setup automatically using ip(8) and shown with bridge(8).

A bridge can specify network devices from its own namespace to be automatically added, as well as its own IP address(es).

```
host a
  dev veth0
  dev veth1 otherns/vdev0
  bridgedev vbr0 veth0 veth1 10.0.0.3/8
```

Devices included in a bridge generally do not need their own IP address (although that is permitted).

Bridges cannot have a pair themselves, but any devices added to a bridge need a pair as usual.

route ROUTECMD

Specify an additional network route for a host.

Most commonly to add a default route from hosts on a "LAN" to the machine that acts as a gateway, e.g.:

```
route default via 10.0.0.254
```

The syntax of ROUTECMD is anything that can fit this pattern:

```
ip route add ROUTECMD
```

See ip(8) and ip-route(8) for help adding routes. If you want to do anything more complex than simply adding routes, use the exec configuration statement.

pre_up DEVICE CUSTOMCMD

Execute custom commands in a host or switch just before bringing up the specified device. All of the pre_up statements for a device are combined and executed in the namespace.

In addition to any explicitly defined interfaces, switches have an implicit bridge device called switch which can also be used in pre_up commands.

Bridges always start after other devices, so to run a command after all everything has been created but before any interfaces are up, you can make use of pre_up on the first defined dev.

See below for some common uses for custom pre_up and exec commands.

exec CUSTOMCMD

Execute a custom command in a host or switch once the rest of the namespace setup is complete.

Once all the namespaces are created, the final step in setting each one up is to have its exec statements combined and executed.

It is roughly the equivalent to writing your own script and executing it after vnetbuild start has finished:

```
sudo ip netns exec myns ./myscript.sh
```

See below for some common uses for custom pre_up and exec commands.

## COMMON CUSTOM COMMANDS
For the most part it doesn't matter whether these commands are used in pre_up or exec operations - the only difference is when they will execute, so e.g. if you want a firewall in place before any interfaces come up then start it from the pre_up of the first device. If you only want the firewall after all devices are up, put it in exec, e.g.:

```
host myfirewall
    ...
    exec firehol myfirewall.conf start
```

Forwarding is not enabled by the Linux kernel when a namespace is first created. This can be easily done for any hosts that need to forward traffic:

```
host mygateway
    ...
    exec echo 1 > /proc/sys/net/ipv4/ip_forward
```

The exec operates in the mygateway namespace so your host is not affected.

Bridges are created without STP being enabled. To enable STP to ensure loops are not created, the following can be done:

```
host myhost
    bridgedev vbr0 ...
    ...
    pre_up vbr0 echo 2 > /sys/class/net/vbr0/bridge/stp_state
switch myswitch
    ...
    pre_up switch echo 2 > /sys/class/net/vbr0/bridge/stp_state
```

You could also use brctl stp vbr0 on and brctl stp switch on instead of setting the values directly. To disable multicast snooping you can use exactly the same method e.g.:

```
switch myswitch
    ...
    pre_up switch echo 0 > /sys/class/net/switch/bridge/multicast_snooping
```

It is possible to run firehol within a namespace to set up custom

Logs from network namespaces are not included in the normal system logs. To enable iptables logging you must start an instance of ulogd(8) in the namespace and use ULOG or NFLOG logging. For FireHOL, that means set FIREHOL_LOG_MODE=ULOG or FIREHOL_LOG_MODE=NFLOG. Note that NFLOG only works with ulogd version 2.

The default configuration for ulogd(8) is /etc/ulogd.conf. Assuming the default place it will write iptables logs to is /var/log/ulog/syslogemu.log (otherwise change the sed command as required), it is simple to set up per-namespace logging:

```
host mygateway
  ...
  exec sed 's:/var/log/ulog/syslogemu.log:/var/log/ulog/mygateway.log:' /etc/ulogd.conf > $NSTMP/ulogd.conf
  exec /usr/sbin/ulogd -d -c $NSTMP/ulogd.conf
```

The -d flag to ulogd(8) makes it become a daemon; when vnetbuild stop executes it will automatically kill any programs running in the namespaces is is stopping, which includes the logging daemon.

The configuration file will get cleaned as soon as vnetbuild start is finished. To be able to access such files you need to write them to a location not under $NSTMP or create them outside the vnetbuild configuration altogether.

## EXAMPLE
A simple LAN arrangement with two hosts, one of which is a gateway to third host:

```
host host01
  dev veth0 10.0.0.1/8
  dev vppp0 192.168.0.1/24
  exec echo 1 > /proc/sys/net/ipv4/ip_forward
  route default via 192.168.0.1
host host02
  dev veth0 10.0.0.2/8
  route default via 10.0.0.1
switch lan
  dev d01 host01/veth0
  dev d02 host02/veth0
host extern01
  dev veth0 host01/vppp0 192.168.0.254/24
  route default via 192.168.0.1
  exec echo 1 > /proc/sys/net/ipv4/ip_forward
```

## LIMITATIONS
When created, the namespaces setup by vnetbuild are completely disconnected from any real network. There is no way of defining such a connection in the vnetbuild configuration as allowing it would lead to conflicts with the normal network setup tools and configuration files in most distributions.

It is possible to arrange your network so you can connect real devices into one or more network namespaces. For the general approach see this mailing list post (http://lists.firehol.org/pipermail/firehol-support/2015-April/003043.html).

## SEE ALSO
•

vnetbuild(1) - VNetBuild program

•

FireHOL Website (http://firehol.org/)

•

VNetBuild Online PDF Manual (http://firehol.org/vnetbuild-manual.pdf)

•

VNetBuild Online Documentation (http://firehol.org/documentation/)

•

ip(8) (http://manpages.ubuntu.com/manpages/trusty/man8/ip.8.html) - show/manipulate network devices

•

ip-route(8) (http://manpages.ubuntu.com/manpages/trusty/man8/ip-route.8.html) - routing table management

•

bridge(8) (http://manpages.ubuntu.com/manpages/trusty/man8/bridge.8.html) - routing table management

•

ulogd(8) (http://manpages.ubuntu.com/manpages/trusty/man8/ulogd.8.html) - netfilter/iptables logging daemon

## AUTHORS
FireHOL Team.


firejail-login

package: firejail

title: firejail-login(5)

summary: Login file syntax for Firejail

text:
# firejail-login(5)

## NAME
login.users - Login file syntax for Firejail

## DESCRIPTION
/etc/firejail/login.users file describes additional arguments passed to the firejail executable upon user logging into a Firejail restricted shell. Each user entry in the file consists of a user name followed by the arguments passed to firejail. The format is as follows:

user_name: arguments

Example:

netblue: --net=none --protocol=unix

Wildcard patterns are accepted in the user name field:

user*: --private

## RESTRICTED SHELL
To configure a restricted shell, replace /bin/bash with /usr/bin/firejail in the /etc/passwd file for each user that needs to be restricted. Alternatively, you can specify /usr/bin/firejail using the `adduser` or `usermod` commands:

adduser --shell /usr/bin/firejail username

usermod --shell /usr/bin/firejail username

## FILES
/etc/firejail/login.users

## LICENSE
Firejail is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Homepage: https://firejail.wordpress.com

## SEE ALSO
firejail(1), firemon(1), firecfg(1), firejail-profile(5), firejail-users(5), jailcheck(1)


firejail-profile

title: firejail-profile(5)

text:
# firejail-profile(5)

## NAME
profile - Security profile file syntax, and information about building new application profiles.

## SYNOPSIS
Using a specific profile:

firejail --profile=filename.profile

Example:

$ firejail --appimage --profile=/etc/firejail/kdenlive.profile kdenlive.appimage

firejail --profile=profile_name

Example:

$ firejail --appimage --profile=kdenlive kdenlive.appimage

Building a profile manually:

Start with the template in /usr/share/doc/firejail/profile.template and modify it in a text editor. To integrate the program in your desktop environment copy the profile file in ~/.config/firejail directory and run "sudo firecfg".

Aliases and redirections:

In some cases the same profile can be used for several applications. One such example is LibreOffice. Build a regular profile for the main application, and for the rest use /usr/share/doc/firejail/redirect_alias-profile.template.

Running the profile builder:

firejail --build=appname.profile appname

Example:

$ firejail --build=blobby.profile /usr/bin/blobby

Run the program in "firejail --build" and try to exercise as many program features as possible. The profile is extracted and saved in the current directory. Open it in a text editor and add or remove sandboxing options as necessary. Test again after modifying the profile. To integrate the program in your desktop environment copy the profile file in ~/.config/firejail directory and run "sudo firecfg".

## DESCRIPTION
Several command line options can be passed to the program using profile files. Firejail chooses the profile file as follows:

1. If a profile file is provided by the user with --profile option, the profile file is loaded. If a profile name is given, it is searched for first in the ~/.config/firejail directory and if not found then in /etc/firejail directory. Profile names do not include the .profile suffix. Example:

$ firejail --profile=/home/netblue/icecat.profile /usr/bin/icecat

Reading profile /home/netblue/icecat.profile

[...]

$ firejail --profile=icecat /usr/bin/icecat-wrapper.sh

Reading profile /etc/firejail/icecat.profile

[...]

2. If a profile file with the same name as the application is present in ~/.config/firejail directory or in /etc/firejail, the profile is loaded. ~/.config/firejail takes precedence over /etc/firejail. Example:

$ firejail /usr/bin/icecat

Command name #icecat#

Found icecat profile in /home/netblue/.config/firejail directory

Reading profile /home/netblue/.config/firejail/icecat.profile

[...]

3. Use a default.profile file if the sandbox is started by a regular user, or a server.profile file if the sandbox is started by root. Firejail looks for these files in ~/.config/firejail directory, followed by /etc/firejail directory. To disable default profile loading, use --noprofile command option. Example:

$ firejail

Reading profile /etc/firejail/default.profile

Parent pid 8553, child pid 8554

Child process initialized

[...] $ firejail --noprofile

Parent pid 8553, child pid 8554

Child process initialized

[...]

## Templates
In /usr/share/doc/firejail there are two templates to write new profiles.

profile.template - for regular profiles

redirect_alias-profile.template - for aliasing/redirecting profiles

## Scripting
Scripting commands:

File and directory names

File and directory names containing spaces are supported. The space character ' ' should not be escaped. Example: "blacklist ~/My Virtual Machines"

\# this is a comment

Example: # disable networking

net none # this command creates an empty network namespace

?CONDITIONAL: profile line

Conditionally add profile line. Example: "?HAS_APPIMAGE: whitelist ${HOME}/special/appimage/dir"

This example will load the whitelist profile line only if the --appimage option has been specified on the command line.

Currently the only conditionals supported this way are HAS_APPIMAGE, HAS_NET, HAS_NODBUS, HAS_NOSOUND, HAS_PRIVATE and HAS_X11. The conditionals ALLOW_TRAY, BROWSER_DISABLE_U2F and BROWSER_ALLOW_DRM can be enabled or disabled globally in Firejail's configuration file.

The profile line may be any profile line that you would normally use in a profile except for "quiet" and "include" lines.

Note: When using one or more conditionals and --profile, it is recommended that the relevant option(s) (such as --appimage) be specified before --profile, so that their respective conditional(s) (such as ?HAS_APPIMAGE) inside of the profile evaluate to true.

include other.profile

Include other.profile file. Example: "include /etc/firejail/disable-common.inc"

The file name can be prefixed with a macro such as ${HOME} or ${CFG}. ${HOME} is expanded as user home directory, and ${CFG} is expanded as Firejail system configuration directory - in most cases /etc/firejail or /usr/local/etc/firejail.

Example: "include ${HOME}/myprofiles/profile1" will load "~/myprofiles/profile1" file.

Example: "include ${CFG}/firefox.profile" will load "/etc/firejail/firefox.profile" file.

The file name may also be just the name without the leading directory components. In this case, first the user config directory (${HOME}/.config/firejail) is searched for the file name and if not found then the system configuration directory is search for the file name. Note: Unlike the --profile option which takes a profile name without the '.profile' suffix, include must be given the full file name.

Example: "include firefox.profile" will load "${HOME}/.config/firejail/firefox.profile" file and if it does not exist "${CFG}/firefox.profile" will be loaded.

System configuration files in ${CFG} are overwritten during software installation. Persistent configuration at system level is handled in ".local" files. For every profile file in ${CFG} directory, the user can create a corresponding .local file storing modifications to the persistent configuration. Persistent .local files are included at the start of regular profile files.

noblacklist file_name

If the file name matches file_name, the file will not be blacklisted in any blacklist commands that follow. Example: "noblacklist ${HOME}/.mozilla"

nowhitelist file_name

If the file name matches file_name, the file will not be whitelisted in any whitelist commands that follow. Example: "nowhitelist ~/.config"

ignore

Ignore command. Example: "ignore seccomp"

Example: "ignore net eth0"

quiet

Disable Firejail's output. This should be the first uncommented command in the profile file. Example: "quiet"

warn message

Print a warning message to stderr. Everything after the command is printed in a warning message as is (that is, without macro expansion). Example: "warn This file is deprecated; use foo instead."

## Filesystem
These profile entries define a chroot filesystem built on top of the existing host filesystem. Each line describes a file/directory that is inaccessible (blacklist), a read-only file or directory (read-only), a tmpfs mounted on top of an existing directory (tmpfs), or mount-bind a directory or file on top of another directory or file (bind). Use private to set private mode. File globbing is supported, and PATH and HOME directories are searched, see the firejail(1) FILE GLOBBING section for more details. Examples:

blacklist file_or_directory

Blacklist directory or file. This makes a file or directory completely inaccessible. All other files and directories are unaffected. The blacklisted file or directory is still visible on the filesystem, even if it's inaccessible. Symbolic link handling: Blacklisting a path that is a symbolic link will also blacklist the path that it points to. For example, if ~/foo is blacklisted and it points to /bar, then /bar will also be blacklisted.

Examples:

blacklist /usr/bin

blacklist /usr/bin/gcc*

blacklist ${PATH}/ifconfig

blacklist ${HOME}/.ssh

blacklist-nolog file_or_directory

When --tracelog flag is set, blacklisting generates syslog messages if the sandbox tries to access the file or directory. blacklist-nolog command disables syslog messages for this particular file or directory. Examples: blacklist-nolog /usr/bin

blacklist-nolog /usr/bin/gcc*

bind directory1,directory2

Mount-bind directory1 on top of directory2. This option is only available when running as root.

bind file1,file2

Mount-bind file1 on top of file2. This option is only available when running as root.

disable-mnt

Disable /mnt, /media, /run/mount and /run/media access.

keep-config-pulse

Disable automatic ~/.config/pulse init, for complex setups such as remote pulse servers or non-standard socket paths.

keep-dev-ntsync

Allow access to the /dev/ntsync character device (even with private-dev), which is blocked by default. This device is mostly intended to increase performance and compatibility when running certain programs through Wine.

keep-dev-shm

/dev/shm directory is untouched (even with private-dev).

keep-dev-tpm

Allow access to Trusted Cryptography Module (TCM) and Trusted Platform Module (TPM) devices (even with private-dev), which are blocked by default.

keep-shell-rc

Do not copy shell rc files (such as ~/.bashrc and ~/.zshrc) from /etc/skel.

keep-var-tmp

/var/tmp directory is untouched.

mkdir directory

Create a directory in user home, under /tmp, or under /run/user/<UID> before the sandbox is started. The directory is created if it doesn't already exist. Use this command for whitelisted directories you need to preserve when the sandbox is closed. Without it, the application will create the directory, and the directory will be deleted when the sandbox is closed. Subdirectories are recursively created. Example from firefox profile:

mkdir ~/.mozilla

whitelist ~/.mozilla

mkdir ~/.cache/mozilla/firefox

whitelist ~/.cache/mozilla/firefox

For files in /run/user/<PID> use ${RUNUSER} macro:

mkdir ${RUNUSER}/firejail-testing

mkfile file

Similar to mkdir, this command creates an empty file in user home, or /tmp, or under /run/user/<UID> before the sandbox is started. The file is created if it doesn't already exist.

noexec file_or_directory

Remount the file or the directory noexec, nodev and nosuid.

private

Mount new /root and /home/user directories in temporary filesystems. All modifications are discarded when the sandbox is closed.

private directory

Use directory as user home. --private and --private=directory cannot be used together. Bug: Even with this enabled, some firejail commands (such as mkdir, mkfile and private-cache) will still operate on the original home directory. Workaround: Disable the incompatible commands, such as by using "ignore mkdir" and "ignore mkfile". For details, see #903.

private-bin file,file

Build a new /bin in a temporary filesystem, and copy the programs in the list. The files in the list must be expressed as relative to the /bin, /sbin, /usr/bin, /usr/sbin, or /usr/local/bin directories. The same directory is also bind-mounted over /sbin, /usr/bin and /usr/sbin. Multiple private-bin commands are allowed and they accumulate.

private-cache

Mount an empty temporary filesystem on top of the .cache directory in user home. All modifications are discarded when the sandbox is closed.

private-cwd

Set working directory inside jail to the home directory, and failing that, the root directory.

private-cwd directory

Set working directory inside the jail. Full directory path is required. Symbolic links are not allowed.

private-dev

Create a new /dev directory. Only disc, dri, dvb, full, hidraw, log, null, ptmx, pts, random, shm, snd, tty, urandom, usb, video and zero devices are available. Use the options no3d, nodvd, nosound, notv, nou2f and novideo for additional restrictions.

private-etc file,directory

Build a new /etc in a temporary filesystem, and copy the files and directories in the list. The files and directories in the list must be expressed as relative to the /etc directory, and must not contain the / character (e.g., /etc/foo must be expressed as foo, but /etc/foo/bar -- expressed as foo/bar -- is disallowed). All modifications are discarded when the sandbox is closed. Multiple private-etc commands are allowed and they accumulate.

private-home file,directory

Build a new user home in a temporary filesystem, and copy the files and directories in the list in the new home. The files and directories in the list must be expressed as relative to the current user's home directory. All modifications are discarded when the sandbox is closed.

private-opt file,directory

Build a new /opt in a temporary filesystem, and copy the files and directories in the list. The files and directories in the list must be expressed as relative to the /opt directory, and must not contain the / character (e.g., /opt/foo must be expressed as foo, but /opt/foo/bar -- expressed as foo/bar -- is disallowed). All modifications are discarded when the sandbox is closed.

private-srv file,directory

Build a new /srv in a temporary filesystem, and copy the files and directories in the list. The files and directories in the list must be expressed as relative to the /srv directory, and must not contain the / character (e.g., /srv/foo must be expressed as foo, but /srv/foo/bar -- expressed as foo/bar -- is disallowed). All modifications are discarded when the sandbox is closed.

private-tmp

Mount an empty temporary filesystem on top of /tmp directory whitelisting /tmp/.X11-unix.

read-only file_or_directory

Make directory or file read-only.

read-write file_or_directory

Make directory or file read-write.

tmpfs directory

Mount an empty tmpfs filesystem on top of directory. Directories outside user home or not owned by the user are not allowed. Sandboxes running as root are exempt from these restrictions.

tracelog

Blacklist violations logged to syslog.

whitelist file_or_directory

Whitelist directory or file. A temporary file system is mounted on the top directory. In the context of firejail, top directory means, if the whitelisted file's path is for example /etc/somedir/somefile, then the top directory would be /etc. All other top directories like /opt, /usr and so on, haven't changed, so all files there are still accessible, unless a file or directory inside them is also whitelisted. This is why sometimes it's beneficial to use blacklist in combination with whitelist, if used for different top directories. The whitelisted files are mount-binded inside. Modifications to whitelisted files are persistent, everything else in the same top directory is discarded when the sandbox is closed.

The top directory can be most directories in /, but there are some special cases. The /proc and /sys top directories aren't allowed, but /sys/module is allowed. Also /run/user/$UID, $HOME and all directories in /usr are treated as a top directory.

Symbolic link handling: Whitelisting a path that is a symbolic link will also whitelist the path that it points to. For example, if ~/foo is whitelisted and it points to ~/bar, then ~/bar will also be whitelisted.

Restrictions: With the exception of the user home directory, both the link and the real file should be in the same top directory. For symbolic links in the user home directory, both the link and the real file should be owned by the user.

whitelist-ro file_or_directory

Equivalent to "whitelist file_or_directory" followed by "read-only file_or_directory"

writable-etc

Mount /etc directory read-write.

writable-run-user

Disable the default blacklisting of run/user/$UID/systemd and /run/user/$UID/gnupg.

writable-var

Mount /var directory read-write.

writable-var-log

Use the real /var/log directory, not a clone. By default, a tmpfs is mounted on top of /var/log directory, and a skeleton filesystem is created based on the original /var/log.

## Security filters
The following security filters are currently implemented:

allow-bwrap

Allow bubblewrap sandbox inside Firejail sandbox. By default Firejail replaces /usr/bin/bwrap executable with a do-nothing program.

allow-debuggers

Allow tools such as strace and gdb inside the sandbox by whitelisting system calls ptrace and process_vm_readv.

caps

Enable default Linux capabilities filter. See capabilities(7) for details.

caps.drop capability,capability,capability

Blacklist given Linux capabilities.

caps.drop all

Blacklist all Linux capabilities.

caps.keep capability,capability,capability

Whitelist given Linux capabilities.

landlock.enforce (experimental)

Enforce the Landlock ruleset. Without it, the other Landlock commands have no effect.

landlock.fs.read path (experimental)

Create a Landlock ruleset (if it doesn't already exist) and add a read access rule for path.

landlock.fs.write path (experimental)

Create a Landlock ruleset (if it doesn't already exist) and add a write access rule for path.

landlock.fs.makeipc path (experimental)

Create a Landlock ruleset (if it doesn't already exist) and add a rule that allows the creation of named pipes (FIFOs) and Unix domain sockets beneath the given path.

landlock.fs.makedev path (experimental)

Create a Landlock ruleset (if it doesn't already exist) and add a rule that allows the creation of block devices and character devices beneath the given path.

landlock.fs.execute path (experimental)

Create a Landlock ruleset (if it doesn't already exist) and add an execution permission rule for path.

memory-deny-write-execute

Install a seccomp filter to block attempts to create memory mappings that are both writable and executable, to change mappings to be executable or to create executable shared memory.

nonewprivs

Sets the NO_NEW_PRIVS prctl. This ensures that child processes cannot acquire new privileges using execve(2); in particular, this means that calling a suid binary (or one with file capabilities) does not result in an increase of privilege.

noprinters

Disable printers.

noroot

Use this command to enable an user namespace. The namespace has only one user, the current user. There is no root account (uid 0) defined in the namespace.

protocol protocol1,protocol2,protocol3

Enable protocol filter. The filter is based on seccomp and checks the first argument to socket system call. Recognized values: unix, inet, inet6, netlink, packet, and bluetooth. Multiple protocol commands are allowed and they accumulate.

restrict-namespaces

Install a seccomp filter that blocks attempts to create new cgroup, ipc, net, mount, pid, time, user or uts namespaces.

restrict-namespaces cgroup,ipc,net,mnt,pid,time,user,uts

Install a seccomp filter that blocks attempts to create any of the specified namespaces.

seccomp

Enable seccomp filter and blacklist the syscalls in the default list. See man 1 firejail for more details.

seccomp.32

Enable seccomp filter and blacklist the syscalls in the default list for 32 bit system calls on a 64 bit architecture system.

seccomp syscall,syscall,syscall

Enable seccomp filter and blacklist the system calls in the list on top of default seccomp filter.

seccomp.32 syscall,syscall,syscall

Enable seccomp filter and blacklist the system calls in the list on top of default seccomp filter for 32 bit system calls on a 64 bit architecture system.

seccomp.block-secondary

Enable seccomp filter and filter system call architectures so that only the native architecture is allowed.

seccomp.drop syscall,syscall,syscall

Enable seccomp filter and blacklist the system calls in the list.

seccomp.32.drop syscall,syscall,syscall

Enable seccomp filter and blacklist the system calls in the list for 32 bit system calls on a 64 bit architecture system.

seccomp.keep syscall,syscall,syscall

Enable seccomp filter and whitelist the system calls in the list.

seccomp.32.keep syscall,syscall,syscall

Enable seccomp filter and whitelist the system calls in the list for 32 bit system calls on a 64 bit architecture system.

seccomp-error-action kill | log | ERRNO

Return a different error instead of EPERM to the process, kill it when an attempt is made to call a blocked system call, or allow but log the attempt.

x11

Enable X11 sandboxing.

x11 none

Blacklist /tmp/.X11-unix directory, ${HOME}/.Xauthority and file specified in ${XAUTHORITY} environment variable. Remove DISPLAY and XAUTHORITY environment variables. Stop with error message if X11 abstract socket will be accessible in jail.

x11 xephyr

Enable X11 sandboxing with Xephyr server.

x11 xorg

Enable X11 sandboxing with X11 security extension.

x11 xpra

Enable X11 sandboxing with Xpra server.

x11 xvfb

Enable X11 sandboxing with Xvfb server.

xephyr-extra-params OPTIONS

Set Xephyr server command extra parameters for x11 xephyr. This command should be included in the profile file before x11 xephyr command. Example:

xephyr-extra-params -grayscale

x11 xephyr

xephyr-screen WIDTHxHEIGHT

Set screen size for x11 xephyr. This command should be included in the profile file before x11 xephyr command. Example:

xephyr-screen 640x480

x11 xephyr

## DBus filtering
Access to the session and system DBus UNIX sockets can be allowed, filtered or disabled. To disable the abstract sockets (and force applications to use the filtered UNIX socket) you would need to request a new network namespace using --net command. Another option is to remove unix from the --protocol set.

Filtering requires installing the xdg-dbus-proxy utility. Filter rules can be specified for well-known DBus names, but they are also propagated to the owning unique name, too. The permissions are "sticky" and are kept even if the corresponding well-known name is released (however, applications rarely release well-known names in practice). Names may have a .* suffix to match all names underneath them, including themselves (e.g. "foo.bar.*" matches "foo.bar", "foo.bar.baz" and "foo.bar.baz.quux", but not "foobar"). For more information, see xdg-dbus-proxy(1).

Examples:

dbus-system filter

Enable filtered access to the system DBus. Filters can be specified with the dbus-system.talk and dbus-system.own commands.

dbus-system none

Disable access to the system DBus. Once access is disabled, it cannot be relaxed to filtering.

dbus-system.broadcast org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications

Allow the application to receive broadcast signals from the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the system DBus.

dbus-system.call org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications

Allow the application to call methods of the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the system DBus.

dbus-system.own org.gnome.ghex.*

Allow the application to own the name org.gnome.ghex and all names underneath in on the system DBus.

dbus-system.see org.freedesktop.Notifications

Allow the application to see but not talk to the name org.freedesktop.Notifications on the system DBus.

dbus-system.talk org.freedesktop.Notifications

Allow the application to talk to the name org.freedesktop.Notifications on the system DBus.

dbus-user filter

Enable filtered access to the session DBus. Filters can be specified with the dbus-user.talk and dbus-user.own commands.

dbus-user none

Disable access to the session DBus. Once access is disabled, it cannot be relaxed to filtering.

dbus-user.broadcast org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications

Allow the application to receive broadcast signals from the the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the session DBus.

dbus-user.call org.freedesktop.Notifications=org.freedesktop.Notifications.*@/org/freedesktop/Notifications

Allow the application to call methods of the interface org.freedesktop.Notifications of the object exposed at the path /org/freedesktop/Notifications by the client owning the bus name org.freedesktop.Notifications on the session DBus.

dbus-user.own org.gnome.ghex.*

Allow the application to own the name org.gnome.ghex and all names underneath in on the session DBus.

dbus-user.see org.freedesktop.Notifications

Allow the application to see but not talk to the name org.freedesktop.Notifications on the session DBus.

dbus-user.talk org.freedesktop.Notifications

Allow the application to talk to the name org.freedesktop.Notifications on the session DBus.

nodbus (deprecated)

Disable D-Bus access (both system and session buses). Equivalent to dbus-system none and dbus-user none.

Individual filters can be overridden via the --ignore command. Supposing a profile has

[...]

dbus-user filter

dbus-user.own org.mozilla.firefox.*

dbus-user.talk org.freedesktop.Notifications

dbus-system none

[...]

and the user wants to disable notifications, this can be achieved by putting the below in a local override file:

[...]

ignore dbus-user.talk org.freedesktop.Notifications

[...]

## Resource limits, CPU affinity
These profile entries define the limits on system resources (rlimits) for the processes inside the sandbox. The limits can be modified inside the sandbox using the regular ulimit command. cpu command configures the CPU cores available.

Examples:

cpu 0,1,2

Use only CPU cores 0, 1 and 2.

nice -5

Set a nice value of -5 to all processes running inside the sandbox.

rlimit-as 123456789012

Set the maximum size of the process's virtual memory to 123456789012 bytes.

rlimit-cpu 123

Set the maximum CPU time in seconds.

rlimit-fsize 1024

Set the maximum file size that can be created by a process to 1024 bytes.

rlimit-nproc 1000

Set the maximum number of processes that can be created for the real user ID of the calling process to 1000.

rlimit-nofile 500

Set the maximum number of files that can be opened by a process to 500.

rlimit-sigpending 200

Set the maximum number of processes that can be created for the real user ID of the calling process to 200.

timeout hh:mm:ss

Kill the sandbox automatically after the time has elapsed. The time is specified in hours/minutes/seconds format.

## User Environment
allusers

All user home directories are visible inside the sandbox. By default, only current user home directory is visible.

env name=value

Set environment variable. Examples: env LD_LIBRARY_PATH=/opt/test/lib

env CFLAGS="-W -Wall -Werror"

ipc-namespace

Enable a new IPC namespace if the sandbox was started as a regular user. IPC namespace is enabled by default for sandboxes started as root. Note: This only affects the IPC resources that are mentioned in ipc_namespaces(7). It does not affect other IPC resources, such as Unix sockets (see unix(7)).

keep-fd

Inherit open file descriptors to sandbox.

name sandboxname

Set sandbox name. Example: name browser

no3d

Disable 3D hardware acceleration.

noautopulse (deprecated)

See keep-config-pulse.

nodvd

Disable DVD and audio CD devices.

nogroups

Disable supplementary user groups

noinput

Disable input devices.

nosound

Disable sound system.

notpm (deprecated)

Ignored for compatibility.

TPM devices are now blocked by default, see keep-dev-tpm.

notv

Disable DVB (Digital Video Broadcasting) TV devices.

nou2f

Disable U2F devices.

novideo

Disable video capture devices.

machine-id

Spoof id number in /etc/machine-id file - a new random id is generated inside the sandbox.

## Networking
Networking features available in profile files.

defaultgw address

Use this address as default gateway in the new network namespace.

dns address

Set a DNS server for the sandbox. Up to three DNS servers can be defined.

hostname name

Set a hostname for the sandbox.

hostname-randomize

Set sandbox hostname to a random value generated by firejail.

hosts-file file

Use file as /etc/hosts.

ip address

Assign IP addresses to the last network interface defined by a net command. A default gateway is assigned by default. Example:

net eth0

ip 10.10.20.56

ip dhcp

Acquire an IP address and default gateway for the last interface defined by a net command, as well as set the DNS servers according to the DHCP response. This command requires the ISC dhclient DHCP client to be installed and will start it automatically inside the sandbox. Example:

net br0

ip dhcp

This command should not be used in conjunction with the dns command if the DHCP server is set to configure DNS servers for the clients, because the manually specified DNS servers will be overwritten.

The DHCP client will NOT release the DHCP lease when the sandbox terminates. If your DHCP server requires leases to be explicitly released, consider running a DHCP client and releasing the lease manually in conjunction with the net none command.

ip none

No IP address and no default gateway are configured for the last interface defined by a net command. Use this option in case you intend to start an external DHCP client in the sandbox. Example:

net eth0

ip none

ip6 address

Assign IPv6 addresses to the last network interface defined by a net command. Example:

net eth0

ip6 2001:0db8:0:f101::1/64

ip6 dhcp

Acquire an IPv6 address and default gateway for the last interface defined by a net command, as well as set the DNS servers according to the DHCP response. This command requires the ISC dhclient DHCP client to be installed and will start it automatically inside the sandbox. Example:

net br0

ip6 dhcp

This command should not be used in conjunction with the dns command if the DHCP server is set to configure DNS servers for the clients, because the manually specified DNS servers will be overwritten.

The DHCP client will NOT release the DHCP lease when the sandbox terminates. If your DHCP server requires leases to be explicitly released, consider running a DHCP client and releasing the lease manually.

iprange address,address

Assign an IP address in the provided range to the last network interface defined by a net command. A default gateway is assigned by default. Example:

net eth0

iprange 192.168.1.150,192.168.1.160

mac address

Assign MAC addresses to the last network interface defined by a net command.

mtu number

Assign a MTU value to the last network interface defined by a net command.

net bridge_interface

Enable a new network namespace and connect it to this bridge interface. Unless specified with option --ip and --defaultgw, an IP address and a default gateway will be assigned automatically to the sandbox. The IP address is verified using ARP before assignment. The address configured as default gateway is the bridge device IP address. Up to four --net bridge devices can be defined. Mixing bridge and macvlan devices is allowed.

net ethernet_interface|wireless_interface

Enable a new network namespace and connect it to this ethernet interface using the standard Linux macvlan or ipvlan driver. Unless specified with option --ip and --defaultgw, an IP address and a default gateway will be assigned automatically to the sandbox. The IP address is verified using ARP before assignment. The address configured as default gateway is the default gateway of the host. Up to four --net devices can be defined. Mixing bridge and macvlan devices is allowed.

net none

Enable a new, unconnected network namespace. The only interface available in the new namespace is a new loopback interface (lo). Use this option to deny network access to programs that don't really need network access.

net tap_interface

Enable a new network namespace and connect it to this ethernet tap interface using the standard Linux macvlan driver. If the tap interface is not configured, the sandbox will not try to configure the interface inside the sandbox. Please use ip, netmask and defaultgw to specify the configuration.

netfilter

If a new network namespace is created, enabled default network filter.

netfilter filename

If a new network namespace is created, enabled the network filter in filename.

netlock

Generate a custom network filter and enable it.

netmask address

Use this option when you want to assign an IP address in a new namespace and the parent interface specified by --net is not configured. An IP address and a default gateway address also have to be added.

netns namespace

Run the program in a named, persistent network namespace. These can be created and configured using "ip netns".

veth-name name

Use this name for the interface connected to the bridge for --net=bridge_interface commands, instead of the default one.

## Other
deterministic-exit-code

Always exit firejail with the first child's exit status. The default behavior is to use the exit status of the final child to exit, which can be nondeterministic.

deterministic-shutdown

Always shut down the sandbox after the first child has terminated. The default behavior is to keep the sandbox alive as long as it contains running processes.

join-or-start sandboxname

Join the sandbox identified by name or start a new one. Same as "firejail --join=sandboxname" command if sandbox with specified name exists, otherwise same as "name sandboxname".

## FILES
/etc/firejail/appname.profile

Global Firejail configuration consisting mainly of profiles for each application supported by default.

$HOME/.config/firejail/appname.profile

User application profiles, will take precedence over the global profiles.

/usr/share/doc/firejail/profile.template

Template for building new profiles.

/usr/share/doc/firejail/redirect_alias-profile.template

Template for aliasing/redirecting profiles.

## LICENSE
Firejail is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Homepage: https://firejail.wordpress.com

## SEE ALSO
firejail(1), firemon(1), firecfg(1), firejail-login(5), firejail-users(5), jailcheck(1)

https://github.com/netblue30/firejail/wiki/Creating-Profiles


firejail-users

title: firejail-users(5)

summary: Firejail user access database

text:
# firejail-users(5)

## NAME
firejail.users - Firejail user access database

## DESCRIPTION
/etc/firejail/firejail.users lists the users allowed to run firejail SUID executable. root user is allowed by default, user nobody is never allowed.

If the user is not allowed to start the sandbox, Firejail will attempt to run the program without sandboxing it.

If the file is not present in the system, all users are allowed to use the sandbox.

Example:

$ cat /etc/firejail/firejail.users

dustin

lucas

mike

eleven

Use a text editor to add or remove users from the list. You can also use firecfg --add-users command. Example:

$ sudo firecfg --add-users dustin lucas mike eleven

By default, running firecfg creates the file and adds the current user to the list. Example:

$ sudo firecfg

See man 1 firecfg for details.

## ALTERNATIVE SOLUTION
An alternative way of restricting user access to firejail executable is to create a special firejail user group and allow only users in this group to run the sandbox:

\# addgroup --system firejail

\# chown root:firejail /usr/bin/firejail

\# chmod 4750 /usr/bin/firejail

## FILES
/etc/firejail/firejail.users

## LICENSE
Firejail is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Homepage: https://firejail.wordpress.com

## SEE ALSO
firejail(1), firemon(1), firecfg(1), firejail-profile(5), firejail-login(5), jailcheck(1)


firewalld.conf

package: firewalld

title: firewalld.conf(5)

summary: firewalld configuration file

text:
# firewalld.conf(5)

## NAME
firewalld.conf - firewalld configuration file

## SYNOPSIS

```
/etc/firewalld/firewalld.conf

```

## DESCRIPTION
firewalld.conf is loaded by firewalld during the initialization process. The file contains the basic configuration options for firewalld.

## OPTIONS
These are the options that can be set in the config file:

DefaultZone

This sets the default zone for connections or interfaces if the zone is not selected or specified by NetworkManager, initscripts or command line tool. The default zone is public.

MinimalMark

Deprecated. This option is ignored and no longer used. Marks are no longer used internally.

CleanupModulesOnExit

Setting this option to yes or true unloads all firewall-related kernel modules when firewalld is stopped. The default value is no or false.

CleanupOnExit

If firewalld stops, it cleans up all firewall rules. Setting this option to no or false leaves the current firewall rules untouched. The default value is yes or true.

IPv6_rpfilter

Performs reverse path filtering (RPF) on IPv6 packets as per RFC 3704. Possible values: - strict: Performs "strict" filtering as per RFC 3704. This check verifies that the in ingress interface is the same interface that would be used to send a packet reply to the source. That is, ingress == egress. - loose: Performs "loose" filtering as per RFC 3704. This check only verifies that there is a route back to the source through any interface; even if it's not the same one on which the packet arrived. - strict-forward: This is almost identical to "loose", but does not perform RPF for packets targeted to the host (INPUT). - loose-forward: This is almost identical to "loose", but does not perform RPF for packets targeted to the host (INPUT). - no: RPF is completely disabled. The rp_filter for IPv4 is controlled using sysctl. Note: This feature has a performance impact. In most cases the impact is not enough to cause a noticeable difference. It requires route lookups and its execution occurs before the established connections fast path. As such it can have a significant performance impact if there is a lot of traffic. It's enabled by default for security, but can be disabled if performance is a concern. Alternatively one of the variants that only does RPF on forwarded packets may be used.

IndividualCalls

If this option is disabled (it is by default), combined -restore calls are used and not individual calls to apply changes to the firewall. The use of individual calls increases the time that is needed to apply changes and to start the daemon, but is good for debugging as error messages are more specific.

LogDenied

Add logging rules right before reject and drop rules in the INPUT, FORWARD and OUTPUT chains for the default rules and also final reject and drop rules in zones for the configured link-layer packet type. The possible values are: all, unicast, broadcast, multicast and off. The default setting is off, which disables the logging.

AutomaticHelpers

Deprecated. This option is ignored and no longer used.

FirewallBackend

Selects the firewall backend implementation. Possible values are; nftables (default), or iptables. This applies to all firewalld primitives. The only exception is direct and passthrough rules which always use the traditional iptables, ip6tables, and ebtables backends. Note: The iptables backend is deprecated. It will be removed in a future release.

FlushAllOnReload

Flush all runtime rules on a reload. In previous releases some runtime configuration was retained during a reload, namely; interface to zone assignment, and direct rules. This was confusing to users. To get the old behavior set this to "no". Defaults to "yes".

ReloadPolicy

The policy during reload. By default, all traffic except established connections is dropped while reloading the firewall rules. This can be overridden for INPUT, FORWARD and OUTPUT. The accepted values are "DROP", "REJECT" and "ACCEPT", which then applies to all tables. Alternatively, the policy can be specified per table, like "INPUT:REJECT,FORWARD:DROP,OUTPUT:ACCEPT". Defaults to "INPUT:DROP,FORWARD:DROP,OUTPUT:DROP".

RFC3964_IPv4

As per RFC 3964, filter IPv6 traffic with 6to4 destination addresses that correspond to IPv4 addresses that should not be routed over the public internet. Defaults to "yes".

StrictForwardPorts

If set to yes, the generated destination NAT (DNAT) rules will NOT accept traffic that was DNAT'd by other entities, e.g. docker. Firewalld will be strict and not allow published container ports until they're explicitly allowed via firewalld. If set to no, then docker (and podman) integrates seamlessly with firewalld. Published container ports are implicitly allowed. Defaults to "no".

AllowZoneDrifting

Deprecated. This option is ignored and no longer used.

NftablesFlowtable

This may improve forwarded traffic throughput by enabling nftables flowtable. It is a software fastpath and avoids calling nftables rule evaluation for data packets. Its value is a space separate list of interfaces. Example value "eth0 eth1". Defaults to "off".

NftablesCounters

If set to yes, add a counter to every nftables rule. This is useful for debugging and comes with a small performance cost. Defaults to "no".

NftablesTableOwner

If set to yes, the generated nftables rule set will be owned exclusively by firewalld. This prevents other entities from mistakenly (or maliciously) modifying firewalld's rule set. If you intentionally modify firewalld's rules, then you will have to set this to "no". Defaults to "yes".

## SEE ALSO
firewall-applet(1), firewalld(1), firewall-cmd(1), firewall-config(1), firewalld.conf(5), firewalld.direct(5), firewalld.dbus(5), firewalld.icmptype(5), firewall-offline-cmd(1), firewalld.richlanguage(5), firewalld.service(5), firewalld.zone(5), firewalld.zones(5), firewalld.policy(5), firewalld.policies(5), firewalld.ipset(5), firewalld.helper(5)

## NOTES
firewalld home page:

http://firewalld.org

## AUTHORS
Thomas Woerner <twoerner@redhat.com>

Developer

Jiri Popelka <jpopelka@redhat.com>

Developer

Eric Garver <eric@garver.life>

Developer