aboutsummaryrefslogtreecommitdiff
path: root/src/fw.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-04-04 18:46:14 +0200
committerAlex Auvolat <alex@adnab.me>2023-04-04 18:46:14 +0200
commit615f926618471998f85ee184b378b1128340367b (patch)
treebe9b5d5da3e844460a533bea9fefd452892a7f32 /src/fw.rs
parente64be9e8816b9bd5d3d787d1d5d57d460ae37569 (diff)
downloaddiplonat-615f926618471998f85ee184b378b1128340367b.tar.gz
diplonat-615f926618471998f85ee184b378b1128340367b.zip
Add STUN actor that saves autodiscovered IPv4/IPv6 to Consul
Diffstat (limited to 'src/fw.rs')
-rw-r--r--src/fw.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fw.rs b/src/fw.rs
index e18a301..f416e6a 100644
--- a/src/fw.rs
+++ b/src/fw.rs
@@ -11,6 +11,7 @@ pub fn setup(ipt: &iptables::IPTables) -> Result<()> {
// ensure we start from a clean state without any rule already set
cleanup(ipt)?;
+ info!("{}: creating DIPLONAT chain using", ipt.cmd);
ipt
.new_chain("filter", "DIPLONAT")
.context("Failed to create new chain")?;
@@ -23,6 +24,7 @@ pub fn setup(ipt: &iptables::IPTables) -> Result<()> {
pub fn open_ports(ipt: &iptables::IPTables, ports: messages::PublicExposedPorts) -> Result<()> {
for p in ports.tcp_ports {
+ info!("{}: opening TCP port {}", ipt.cmd, p);
ipt
.append(
"filter",
@@ -33,6 +35,7 @@ pub fn open_ports(ipt: &iptables::IPTables, ports: messages::PublicExposedPorts)
}
for p in ports.udp_ports {
+ info!("{}: opening UDP port {}", ipt.cmd, p);
ipt
.append(
"filter",
@@ -80,6 +83,7 @@ pub fn get_opened_ports(ipt: &iptables::IPTables) -> Result<messages::PublicExpo
pub fn cleanup(ipt: &iptables::IPTables) -> Result<()> {
if ipt.chain_exists("filter", "DIPLONAT")? {
+ info!("{}: removing old DIPLONAT chain", ipt.cmd);
ipt
.flush_chain("filter", "DIPLONAT")
.context("Failed to flush the DIPLONAT chain")?;