[SOLVED] Making Arptable settings persist through reboots in CentOS 7
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Making Arptable settings persist through reboots in CentOS 7
I am running CentOS 7 with firewalld enabled and need to setup a few arptable rules. I can set these rules from the command line using the arptables command but they go away after a reboot. I need these rules to persist through reboots.
I've searched the web and while I can find some info on how to use the arptables command, I can't find anything about how to make the rules persistent.
Here's what I've tried so far:
1. Use arptables-save command to dump the config and then run arptables-restore to load the saved config but this doesn't keep the config across reboots.
2. I have tried editing my /etc/sysconfig/arptables file to this:
*filter
:INPUT ACCEPT
:OUTPUT ACCEPT
:FORWARD ACCEPT
-A INPUT -j ACCEPT -i ens192 -d 10.1.1.131
-A INPUT -j ACCEPT -i ens224 -d 9.1.1.131
-A INPUT -j ACCEPT -i ens192 -d 10.2.0.0/16
-A INPUT -j ACCEPT -i ens224 -d 9.2.0.0/16
-A INPUT -j DROP -i ens192 ! -d 10.0.0.0/8
-A INPUT -j DROP -i ens224 ! -d 9.0.0.0/8
-A INPUT -j DROP -i ens256 ! -d 10.255.0.0/16
-A INPUT -j DROP -i ens161 ! -d 9.255.0.0/16
I haven't used it but the rpm installs:
rpm -ql arptables
/etc/sysconfig/arptables
/usr/lib/systemd/system/arptables.service
/usr/libexec/arptables-helper
/usr/sbin/arptables
/usr/sbin/arptables-restore
/usr/sbin/arptables-save
/usr/share/doc/arptables-0.0.4
/usr/share/doc/arptables-0.0.4/COPYING
/usr/share/man/man8/arptables-restore.8.gz
/usr/share/man/man8/arptables-save.8.gz
/usr/share/man/man8/arptables.8.gz
Since this is CentOS7 (or RHEL7) it is doing systemd so I'm wondering if you enabled the arptables.service so it gets copied from /usr/lib/systemd/system to /etc/systemd/system to start at boot?
What does "systemctl status arptables" output?
Last edited by MensaWater; 03-01-2018 at 03:13 PM.
Glad I could help. If you don't mind, please go to thread tools and mark this as Solved. It helps people with similar issues more quickly find the resolution on future web searches.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.