LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-07-2014, 07:14 AM   #1
gprathap1121@gmail.com
LQ Newbie
 
Registered: Jun 2014
Posts: 20

Rep: Reputation: Disabled

In proc file system, there are 2 parameters for each setting, one in "default" and other in "all".
/proc/sys/net/ipv4/conf/default/accept_redirects
/proc/sys/net/ipv4/conf/all/accept_redirects


write /proc/sys/net/ipv4/conf/all/secure_redirects 0
write /proc/sys/net/ipv4/conf/default/secure_redirects 0


Does setting the value of parameter in "all" doesn't configure the default value as well.

Do we need to set both the proc entries to work as desired?
Why do we have 2 parameters for each configuration?

Does the default values come in to picture when we change the VLAN settings, and switch to a different interface?

Last edited by unSpawn; 07-07-2014 at 11:29 AM. Reason: //Retain 0-reply state
 
Old 07-10-2014, 08:02 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
The "default" subdirectory contains parameters assigned to new interfaces, including logical interfaces one might create, such as VLAN and tunnel interfaces.

The "all" subdirectory contains parameters assigned to all interfaces. Changing a parameter in /proc/sys/net/ipv4/conf/all/ will cause it to be applied to all interfaces immediately. It also changes the corresponding /proc/sys/net/ipv4/conf/default/ value.
 
Old 07-11-2014, 01:15 AM   #3
gprathap1121@gmail.com
LQ Newbie
 
Registered: Jun 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
Thank you.
So you mean, setting the value in /proc/sys/net/ipv4/conf/all/, will also update the value in /proc/sys/net/ipv4/conf/default/ right?

But I found that setting the value in /proc/sys/net/ipv4/conf/all/ doesn't update the values in /proc/sys/net/ipv4/conf/default/.
For example:
If we have value 1 for a parameter in /proc/sys/net/ipv4/conf/all/ sub directory and value 0 for the same parameter in /proc/sys/net/ipv4/conf/default/.
Default parameter will be set to 1, even though it is shown as 0?
 
Old 07-11-2014, 01:45 AM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
It's been a while since I read the sysctl documentation so I double-checked, and you're right; it turns out the behavior of the parameters in /proc/sys/net/ipv4/conf/all/ is highly parameter-specific.

In some cases, all/<foo> must be set to 1 (true) for the interface-specific parameter to have any effect at all (true for accept_source_route among others), while in other cases (like igmp_max_memberships) the parameter in /proc/sys/net/ipv4/conf/all/ does indeed affect all interfaces.

In other words, you'll have to check the kernel sysctl documentation for every parameter (and make sure the document you're reading applies to your kernel version).
 
Old 07-14-2014, 12:41 AM   #5
gprathap1121@gmail.com
LQ Newbie
 
Registered: Jun 2014
Posts: 20

Original Poster
Rep: Reputation: Disabled
Below 3 parameters need to be updated explicitly for "all" and "default" sub directories.
/proc/sys/net/ipv4/conf/default/send_redirects 1
/proc/sys/net/ipv4/conf/default/accept_source_route 1
/proc/sys/net/ipv4/conf/default/rp_filter 1
 
  


Reply



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
Can't create file using echo: /proc/sys/net/ipv4/ip_local_port_change rsumbeling Linux - General 4 07-17-2013 04:20 AM
nat not working, cannot change /proc/sys/net/ipv4/ip_forward 70k51k Linux - Networking 7 12-04-2006 10:16 AM
/proc/sys/net/ipv4/ip_local_port_range suse 10.1 not set at boot PredatorX Linux - Networking 4 11-29-2006 01:54 AM
/proc/sys/net/ipv4/ip_local_port_range wetwet Linux - Networking 0 07-06-2004 08:47 AM
default values for /proc/sys/net/ipv4 robeb Linux - Networking 0 06-07-2002 12:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:59 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
Open Source Consulting | Domain Registration