GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
APPJAIL-NETWORK(1) FreeBSD General Commands Manual APPJAIL-NETWORK(1)

appjail-networkCreate, remove or manage virtual networks for jails

appjail network add [-O] [-d description] [-m mtu] name address/cidr

appjail network assign -e interface -j jail -n network [-d] [-a [auto|forceauto|address]]

appjail network attach [-b bridge] [epair|iface:]interface ...

appjail network auto-create

appjail network detach [-Ddfi] [-b bridge] [epair|iface:]interface ...

appjail network fix [all|dup|addr] [-n network]

appjail network get [-eHIpt] network [keyword ...]

appjail network hosts -a -n network

appjail network hosts -d -n network

appjail network hosts -e -j jail

appjail network hosts -l -n network

appjail network hosts -R -j jail [-E] [-n network]

appjail network hosts -r -n network [-H|-N] [-s]

appjail network list [-eHIpt] [-n network] [keyword ...]

appjail network plug -e interface -n network [-d description]

appjail network remove [-df] network

appjail network reserve -j jail -n network [-a [auto|forceauto|address]]

appjail network unplug network interface

The utility creates, removes, and manages virtual networks and bridges. A virtual network consists of one configured if_bridge(4) interface and zero or more if_epair(4) interfaces.

Virtual networks are an essential part of AppJail since with them we can use features such as port forwarding and NAT. Furthermore, this represents a better organization of our jails without the need for a DHCP server.

The options are as follows:

[-O] [-d description] [-m mtu] name address/cidr
Create a new network called name.

address must be a valid IPv4 address and cidr must be a non-negative number between and .

By default, an overlay test is performed to check if the network to be created overlaps an existing network. This test may be a bit slow if you have many networks but it avoids some problems.
description
A brief description about the network.
mtu
Network MTU. A valid MTU is a non-negative number between and . If a network does not have an MTU defined, it uses what is specified by the parameter.
-e interface -j jail -n network [-d] [-a [auto|forceauto|address]]
Assign a non-reserved IPv4 address from network to the if_epair(4) interface inside jail.

If -d is specified, network will be set as the default route. No checking is done if a default route already exists.

See reserve to learn how the IPv4 address is reserved.

[-b bridge] [epair|iface:]interface ...
Attach interface to bridge.

If bridge does not exist, it is created. The default bridge is the one specified by the SHARED_BRIDGE parameter.

If an interface type of epair (default when none is specified) is specified, an if_epair(4) interface is created if it does not exist and if the interface type is iface, an existing interface is attached to the bridge. Remember that all interfaces on a bridge must have the same MTU. The first MTU interface is used, so first specify an iface interface type before an epair interface type. In the case where an interface of type epair is specified first, the MTU specified by the parameter is used, but note that this may not make sense if an interface of type iface is specified with a different MTU.

For an interface of type epair, two interfaces are created since that is how if_epair(4) works, but the interfaces will be called interface and interface, where the first is for the host and the second for the jail.

Call the add subcommand with the parameters , , and to create a new network. This is the preferred method for creating a network implicitly as it is more portable and simpler. It is mainly used by appjail-quick(1).
[-Ddfi] [-b bridge] [epair|iface:]interface ...
Detach or destroy interface from bridge.
Destroy bridge after detaching or destroying the interfaces.
Destroy interfaces instead of simply removing them from the bridge.

To destroy an interface, it must belong to the group; otherwise it is silently ignored. This group is added automatically using the attach subcommand.

If the interface is to be removed as a member of the bridge but does not belong to it, an error may occur. This flag forces this behavior.
Removes or destroys the interface even if it is not a member of the bridge.
[all|dup|addr] [-n network]
Fixes some problems that may occur when using virtual networks.

Problems commonly occur because appjail-jail(1) is used to import a jail with non-portable parameters, such as an IPv4 address that does not belong to any existing virtual network or even the IPv4 may be duplicated. These “problems” may not be problems at all, as they may occur due to a backup when you need to duplicate all settings from another system. It is preferable to use appjail-quick(1) to import a jail as it forcibly reserves an IPv4 address but only when using a virtual network, but when you need to export/import a jail in a portable way use appjail-image(1) instead.

If -n is specified, this subcommand operates on the specified network; otherwise, it operates on all networks.

[-eHIpt] network [keyword ...]
Get information about a network, that is, the keyword that represent the information to be obtained. Multiple keywords can be specified, which are displayed as a table-like interface in the order in which they are specified. If no keyword is specified, the defaults are name, network, cidr, broadcast, gateway, minaddr, maxaddr, addresses, description and .

See KEYWORDS for a list of available keywords.

Not required when using -p. The \t character is used to delimit columns, so as not to show strange values, this option shows instead of \t in the case that a value contains the latter.
Shows the name of the columns.
Include empty values. By default, a minus sign is displayed when a value is empty.
Columnate the list.
Tabulate columns and values.
-a -n network
List available IPv4 addresses in network.
-d -n network
List the IPv4 addresses that are duplicated in network.
-e -j jail
List the networks to which jail belongs.
-l -n network
List all IPv4 addresses in network.
-R -j jail [-E] [-n network]
List assigned IPv4 addresses for jail. If -E is specified, the network to which the IPv4 addresses belong is displayed.

Specify -e to display only IPv4 addresses assigned solely for this network.

-r -n network [-H|-N] [-s]
List assigned IPv4 addresses in network.

If -N is specified, the jail name is displayed after its IPv4 address. The network is shown as and the broadcast as .

Shows the jail's hostname. If -H is specified only once and if the jail does not have a hostname defined in its template, the jail name plus the value specified by the HOST_DOMAIN parameter is displayed as the hostname. If -H is specified twice, the jail name plus the network name plus the value specified by the HOST_DOMAIN parameter is displayed as the hostname, and if -s or is enabled, the jail name is used as secondary hostname for the network specified by the parameter.

An additional hostname will be added if the current jail has the label. This is useful especially when a third-party tool creates a random name but you want to use a human-readable hostname.

[-eHIpt] [-n network] [keyword ...]
get but shows each keyword for each network in a nice table.
, -H, -I, -p, -t
get.
network
network.
-e interface -n network [-d description]
Create a new if_epair(4) interface and an if_bridge(4) interface if it does not exist. The if_epair(4) interface is added as a member of the bridge.

This subcommand assumes that if the bridge is not in the appjail_bridge group, the bridge is not configured correctly, so it proceeds to configure the parameters specified by the add subcommand.

The interfaces ea_interface and interface represent the cloned if_epair(4), the first being for the host and the second for the jail. After the interfaces are created, the MTU is configured as set by the add subcommand. The appjail_epair group is added to ea_interface. If -d is specified, a description is added to ea_interface. And finally, ea_interface is added to the bridge.

[-df] network
Destroy a bridge. To destroy a bridge, it must be in the appjail_bridge group and must have no members unless -f is specified.

If -d is specified, the network is also destroyed, so you can create it again using the add subcommand.

-j jail -n network [-a [auto|forceauto|address]]
Reserve an IPv4 address for jail from network.

If -a is set to auto or forceauto, an IPv4 address is automatically assigned from the network address pool. The difference between auto and forceauto is that the former does not assign an IPv4 address if the jail has one, the exception is when the IPv4 is invalid depending on the network configuration, and the latter is that the IPv4 address is forcibly assigned, that is, the IPv4 address is assigned even if the jail has one.

An IPv4 address can be specified. To be considered valid, it must be a valid IPv4 address and have a correct range depending on the network address and CIDR. The IPv4 address must not also be reserved by another host.

network interface
Destroy ea_interface. To destroy the interface, it must be a member of the bridge network, must exist, and be in the appjail_epair group.

Address used when add was executed.
Total number of hosts.
Broadcast address.
Network prefix.
Network description.
Default gateway.
Last host of the network.
First host of the network.
Network name.
Network mask of the network.
Network address.
Network mask with its bits inverted.

The appjail network utility exits 0 on success, and >0 if an error occurs.

appjail-expose(1) appjail-jail(1) appjail-nat(1) appjail-quick(1) sysexits(3) if_epair(4) if_bridge(4)

Jesús Daniel Colmenares Oviedo <DtxdF@disroot.org>

April 19, 2024 FreeBSD 14.3-RELEASE

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.