


























Bastille is an open-source system for automating deployment and management containerized applications on FreeBSD.
Bastille supports redirecting (rdr) ports from the host system into target
containers. This port redirection is commonly used when running Internet
services such as web servers, dns servers, email and many others. Any service
you want to make public outside of your cluster will likely require port
redirection (with some exceptions, see below).
Port redirection is required for inbound connectivity to loopback (bastille0)
containers or shared interface containers and is handled using a combination of
three things.
rdr-anchor "rdr/*".ext_if= is defined in pf.confIf you need help with these please see our Getting Started Guide or Bastille Networking documentation.
Note: Port redirection is not needed to access VNET-based containers.
Redirecting ports for inbound access to a containerized service can be done
manually using the rdr sub-command or in an automated fashion using a
Bastille template.
The three examples below will demonstrate redirecting the following:
Command Line Usage
bastille rdr TARGET tcp 2200 22
bastille rdr TARGET udp 53 53
bastille rdr TARGET tcp 443 443
Bastille Template Usage
RDR tcp 2200 22
RDR udp 53 53
RDR tcp 443 443
Additionally it is possible to list existing rules for a container:
bastille rdr TARGET list
You may also need to clear redirect rules to remove access:
bastille rdr TARGET clear
Redirection rules are persistent by default. This means that any redirect rules
applied to a target will be written to an rdr.conf for that target
automatically.
Example: /usr/local/bastille/jails/folsom/rdr.conf
tcp 2200 22
udp 53 53
tcp 443 443
The rules found in this file (one per line) will be loaded for the container each time it is started. Redirection rules are also automatically cleared when the container is stopped.
Tip: Use bastille edit TARGET rdr.conf to interactively edit (or manually create)
persistent redirection rules.
Redirecting ports from the host system to the internal network is simple with
the rdr subcommand. This redirection can also be accomplished with the use of
templates to automate the process.
Defining port redirection rules allow external access to your internal
bastille0 network on a per port basis. While port redirection should not be
needed between containers on your bastille0 interface, it is required to
access services from outside.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。