Skip to main content
Topic: sysctl set up (Read 164 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

sysctl set up

I need to set up sysctl correctly and I don't think it is obeying my intention.

I am looking at this webpage

https://wiki.gentoo.org/wiki/Home_router#Kernel_setup_.28know_thyself_first.29

Code: [Select]
FILE /etc/sysctl.conf

net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1


I have this on my file system which did not start packet forwarding

vim /etc/sysctl.d/ipforward.conf

Code: [Select]
sysctl -w net.ipv4.ip_forward = 1
sysctl -w net.ipv4.conf.all.forwarding = 1

That didn't work.  I can pull the sysctl command out maybe but I don't know how to test this.

/etc/init.d/sysctl -vd restart
says nothing about forwarding


Re: sysctl set up

Reply #1
What do you get when you run
Code: [Select]
sysctl -a|grep net.ipv4.ip_forward

However, I'm almost certain you're talking about NAT/masquerading, which is handled by iptables.

Re: sysctl set up

Reply #2
What do you get when you run
Code: [Select]
sysctl -a|grep net.ipv4.ip_forward

However, I'm almost certain you're talking about NAT/masquerading, which is handled by iptables.


forwarding packets without masquarading is not that useful.  I think I need both.

Re: sysctl set up

Reply #3
What do you get when you run
Code: [Select]
sysctl -a|grep net.ipv4.ip_forward

However, I'm almost certain you're talking about NAT/masquerading, which is handled by iptables.


Code: [Select]
www3 etc]# sysctl -a|grep net.ipv4.ip_forward
net.ipv4.ip_forward = 1
net.ipv4.ip_forward_use_pmtu = 0

this might be after I fixed it though.  I think the problems is how to set it to boot like that?


Re: sysctl set up

Reply #4
You need to put the values in /etc/sysctl.conf or in any file inside /etc/sysctl.d/ ending in .conf. The openrc initscript reads them all, giving precedence to the former.