Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't initialize iptables table 'filter' #27

Open
backupandforkacc opened this issue Jan 3, 2022 · 4 comments
Open

Can't initialize iptables table 'filter' #27

backupandforkacc opened this issue Jan 3, 2022 · 4 comments

Comments

@backupandforkacc
Copy link

I was using the following docker-compose.yaml:

version: '3.3'
services:
  freepbx:
    image: flaviostutz/freepbx
    ports:
      - 8092:80
      - 5060:5060/udp
      - 5160:5160/udp
      - 3306:3306
      - 18000-18100:18000-18100/udp
    environment:
      - ADMIN_PASSWORD=admin123
    volumes:
      - backup:/backup
      - recordings:/var/spool/asterisk/monitor

volumes:
  backup:
  recordings:

I have the following logs:

~/Downloads/freepbx$ sudo docker-compose logs -t -f --tail 10
Attaching to freepbx_freepbx_1
freepbx_1  | 2022-01-03T14:15:45.791808263Z iptables v1.8.2 (legacy): can't initialize iptables table `filter': Permission denied (you must be root)
freepbx_1  | 2022-01-03T14:15:45.791959813Z Perhaps iptables or your kernel needs to be upgraded.
freepbx_1  | 2022-01-03T14:15:45.795578022Z For enabling fail2ban you have to run this container with 'privileged: true'
freepbx_freepbx_1 exited with code 1

I have not configured the network in any way or applied netplan.

@backupandforkacc
Copy link
Author

Changed the code a bit, seems working now:

version: '3.3'
services:
  freepbx:
    image: flaviostutz/freepbx
    ports:
      - 8092:80
      - 5060:5060/udp
      - 5160:5160/udp
      - 3306:3306
      - 18000-18100:18000-18100/udp
    environment:
      - ADMIN_PASSWORD=admin123
    volumes:
      - backup:/backup
      - recordings:/var/spool/asterisk/monitor
    cap_add:
      - NET_ADMIN
volumes:
  backup:
  recordings:

@flaviostutz
Copy link
Owner

flaviostutz commented Jan 3, 2022 via email

@negesti
Copy link

negesti commented Dec 17, 2023

disabling fail2bin in compose file works, looks like it is default tru

environment: 
  - FAIL2BAN_ENABLE=false

@flaviostutz
Copy link
Owner

You need to run the container with privileged true so it has access to ip tables kernel operations from the hosting OS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants