LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-01-2018, 12:03 PM   #1
saldon
LQ Newbie
 
Registered: Jun 2008
Location: USA
Distribution: Ubuntu, OpenSUSE, RedHat
Posts: 27

Rep: Reputation: 1
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

COMMIT

Thanks
 
Old 03-01-2018, 04:11 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,517
Blog Entries: 15

Rep: Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470
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 04:13 PM.
 
1 members found this post helpful.
Old 03-05-2018, 10:57 AM   #3
saldon
LQ Newbie
 
Registered: Jun 2008
Location: USA
Distribution: Ubuntu, OpenSUSE, RedHat
Posts: 27

Original Poster
Rep: Reputation: 1
That was it. Thanks. I should've known that.
 
1 members found this post helpful.
Old 03-05-2018, 12:55 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,517
Blog Entries: 15

Rep: Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make touch input on a touchscreen+external monitor setup work properly and persist across sessions/reboots TheEzekielProject LinuxQuestions.org Member Success Stories 2 08-12-2017 03:45 PM
alsactl wont persist settings and gnome audio slider doesn't work. Recursion Linux - Software 2 06-24-2010 07:58 AM
Nvidia - Keep external monitor settings between reboots undoIT Linux - Hardware 4 07-12-2009 05:15 AM
Wireless settings not sticking across reboots Speed_Demon_X Linux - Wireless Networking 3 06-08-2008 06:09 PM
How to make driver's settings persist across reboots /usr/src Linux - General 3 10-20-2005 03:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration