pub struct Defaults {
pub custom_tables: Option<Vec<Table>>,
pub initialization: Option<Initialization>,
}Expand description
The defaults/configuration for the nftables backend.
Fields§
§custom_tables: Option<Vec<Table>>Specify the names of custom nft-tables that should be partially managed.
§Explanation
If you want to use or already use an existing nftables table to manage rules independently from DFW, it is important that two conditions are met:
- The priority-values of the chains are lower than the priority-values used by DFW.
- The default-policy of the any input or forward chains in the table are set to
accept.
While DFW cannot ensure that the first condition is met (since changing the priority of a
chain is not possible without recreating the chain), it can set the policies of your input
and output chains to accept for you.
§Example
custom_tables = { name = "filter", chains = ["input", "forward"] }
custom_tables = [
{ name = "filter", chains = ["input", "forward"] },
{ name = "custom", chains = ["input", "forward"] }
]initialization: Option<Initialization>The optional initialization section.
§Example
[initialization]
rules = [
"add table inet custom",
"flush table inet custom",
]Trait Implementations§
Source§impl<'de> Deserialize<'de> for Defaults
impl<'de> Deserialize<'de> for Defaults
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Defaults
impl StructuralPartialEq for Defaults
Auto Trait Implementations§
impl Freeze for Defaults
impl RefUnwindSafe for Defaults
impl Send for Defaults
impl Sync for Defaults
impl Unpin for Defaults
impl UnsafeUnpin for Defaults
impl UnwindSafe for Defaults
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.