Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables/firewall for systemd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
luciano
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2004
Posts: 132

PostPosted: Sat Feb 15, 2014 2:25 pm    Post subject: iptables/firewall for systemd Reply with quote

I upgraded to systemd a couple of months ago, following the gentoo systemd guide. However, I've been unable to find support for iptables (or any other firewall for that matter); the stable iptables version 1.4.20 doesn't appear to include init scripts for systemd.

Also there is no replacement service discussed in the howto guide for iptables here http://wiki.gentoo.org/wiki/Systemd#Native_services .

Any suggestions?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23093

PostPosted: Sat Feb 15, 2014 3:54 pm    Post subject: Reply with quote

In openrc, the iptables init script is just a wrapper around calling iptables-restore to load rules at startup and iptables-save to save them to persistent storage at shutdown. If no systemd service exists for it, one should be easy to write. No processes are left running long term for systemd to manage.
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Sat Feb 15, 2014 6:13 pm    Post subject: Reply with quote

mkultra@mkultra [ ~ ] $ locate iptables | grep service

/usr/portage/net-firewall/arno-iptables-firewall/files/arno-iptables-firewall.service


mkultra@mkultra [ ~ ] $ cat /usr/portage/net-firewall/arno-iptables-firewall/files/arno-iptables-firewall.service

Code:

[Unit]
Description=A secure stateful firewall for both single and multi-homed machine
Before=network.target
Wants=network.target

[Service]
Type=oneshot
ExecStart=/usr/sbin/arno-iptables-firewall start
ExecStop=/usr/sbin/arno-iptables-firewall stop
ExecReload=/usr/sbin/arno-iptables-firewall force-reload
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target


and it looks like UFW has systemd service files.

mkultra@mkultra [ ~ ] $ cat /usr/lib64/systemd/system/ufw.service
Code:

[Unit]
Description=Uncomplicated Firewall
DefaultDependencies=no
Before=network.target sysinit.target
After=systemd-sysctl.service
ConditionPathExists=|/etc/ufw/ufw.conf

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/share/ufw/ufw-init start
ExecStop=/usr/share/ufw/ufw-init stop

[Install]
WantedBy=multi-user.target


id probably go with ufw, i just got it up and going on my laptop i haven't tinkered with it with systemd yet....

https://wiki.gentoo.org/wiki/Ufw
Back to top
View user's profile Send private message
luciano
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2004
Posts: 132

PostPosted: Mon Feb 17, 2014 6:04 pm    Post subject: Reply with quote

Thanks for your replies. Based on your comments, I've open an enhancement request: https://bugs.gentoo.org/show_bug.cgi?id=501610
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum