Sign inSign up

capybara1/firewall

By capybara1

Updated about 7 years ago

An image that applies firewall rules via iptables

Image
0

599

capybara1/firewall repository overview

Firewall

Motivation

Primarily a iptables based firewall script, packaged with the required binaries for environments where iptables-restore is not present.

Inspirations

Articles that inspired this solution

Usage

Command Line

Assuming the desired file with the output from iptables-restore is located at /etc/iptables/state

docker run \
  --rm \
  --cap-add=NET_ADMIN \
  --net=host \
  -v /etc/iptables:/host/etc/iptables:ro \
  capybara1/firewall:1.0
Cloud-Init (RancherOS)
write_files:
- path: /etc/iptables/state
  permissions: "0400"
  owner: "root:root"
  content: |
    #insert output of iptables-save here
rancher:
  services:
    firewall:
      image: capybara1/firewall:latest
      net: host
      cap_add:
      - NET_ADMIN
      volumes:
      - /etc/iptables:/host/etc/iptables:ro
      labels:
        io.rancher.os.after: wait-for-network, console
        io.rancher.os.detach: "false"
        io.rancher.os.remove: "true"

Tag summary

Content type

Image

Digest

Size

3.1 MB

Last updated

about 7 years ago

docker pull capybara1/firewall