# sysctl -w net.ipv4.conf.all.send_redirects behaviour

## truc

Hello,

sysctl -w net.ipv4.conf.all.send_redirects=0 doesn't set every net.ipv4.conf.${INTERFACE}.send_redirects to 0.

This would be, I think, the expected behaviour since sudo sysctl -w net.ipv4.conf.all.forwarding=1 does set every net.ipv4.conf.${INTERFACE}.forwarding

```
error: permission denied on key 'net.ipv4.route.flush'

net.ipv4.conf.all.send_redirects = 0

net.ipv4.conf.default.send_redirects = 0

net.ipv4.conf.lo.send_redirects = 1

net.ipv4.conf.eth0.send_redirects = 1

net.ipv4.conf.eth1.send_redirects = 0

error: permission denied on key 'net.ipv6.route.flush'
```

```
net.ipv4.conf.all.send_redirects = 1
```

```
error: permission denied on key 'net.ipv4.route.flush'

net.ipv4.conf.all.send_redirects = 1

net.ipv4.conf.default.send_redirects = 0

net.ipv4.conf.lo.send_redirects = 1

net.ipv4.conf.eth0.send_redirects = 1

net.ipv4.conf.eth1.send_redirects = 0

error: permission denied on key 'net.ipv6.route.flush'
```

```
error: permission denied on key 'net.ipv4.route.flush'

net.ipv4.conf.all.forwarding = 1

net.ipv4.conf.default.forwarding = 1

net.ipv4.conf.lo.forwarding = 1

net.ipv4.conf.eth0.forwarding = 1

net.ipv4.conf.eth1.forwarding = 1

error: permission denied on key 'net.ipv6.route.flush'
```

```
net.ipv4.conf.all.forwarding = 0
```

```

error: permission denied on key 'net.ipv4.route.flush'

net.ipv4.conf.all.forwarding = 0

net.ipv4.conf.default.forwarding = 0

net.ipv4.conf.lo.forwarding = 0

net.ipv4.conf.eth0.forwarding = 0

net.ipv4.conf.eth1.forwarding = 0

error: permission denied on key 'net.ipv6.route.flush'

```

So my question is.. Is this a bug or not?

----------

## Mike81

Hi,

I know the question is old, but did you find an answer? I see the same with "net.ipv4.conf.all.accept_redirects".

When you are googling for "accept_redirects" you will find many howtos/tutorials saying you should set

```
net.ipv4.conf.all.accept_redirects=0
```

in your /etc/sysctl.conf, but when you verify, even after a reboot,

```
# sysctl net.ipv4.conf.eth0.accept_redirects 

net.ipv4.conf.eth0.accept_redirects = 1
```

So it seems like that nobody verify...  :Smile: 

Setting it this via "net.ipv4.conf.default.accept_redirects" will do the trick. So when you reboot (or re-create eth0 without a reboot), everything will be as expected:

```
# sysctl net.ipv4.conf.eth0.accept_redirects 

net.ipv4.conf.eth0.accept_redirects = 0
```

But it would be nice to know

Why does all sometimes work and sometimes not?

Is using default in sysctl.conf the recommended way? Seems to me...

----------

