[Comm] net.ipv4.ip_forward

Stas stas.grumbler на gmail.com
Сб Дек 21 00:09:49 MSK 2019


Доброй ночи.

Как нынче правильно нужно указывать включение net.ipv4.ip_forward и
почему он по умолчанию принудительно устанавливается в "0"?

Вписал как описано в man sysctl в файл /etc/sysctl.d/01-forward.conf -
при загрузке не отрабатывает, приходится ручками запускать `sysctl
--system` .

Потом нашёл
https://www.altlinux.org/Etcnet#%D0%9E%D0%B1%D1%89%D0%B8%D0%B5_%D1%81%D0%B2%D0%B5%D0%B4%D0%B5%D0%BD%D0%B8%D1%8F
, где /etc/sysctl.d/ вообще не указан, зато есть /etc/net/sysctl.conf, в
котором есть строка

net.ipv4.ip_forward = 0

IMHO что-то тут неверно. Обрабатываются ли /etc/sysctl.d/*.conf ? Если
да - это нужно отразить в AltWiki

Также нужно либо дополнять man sysctl информацией про etcnet, либо в 
/etc/net/sysctl.conf убирать "net.ipv4.ip_forward = 0" и другие ключевые
параметры в комментарий.


вот что было после перезагрузки:

[root на mail ~]# grep -R forward /etc/sysctl*
/etc/sysctl.d/01-forward.conf:net.ipv4.ip_forward=1

[root на mail ~]# sysctl -a | grep forward
net.ipv4.conf.all.bc_forwarding = 0
net.ipv4.conf.all.forwarding = 0
net.ipv4.conf.all.mc_forwarding = 0
net.ipv4.conf.default.bc_forwarding = 0
net.ipv4.conf.default.forwarding = 0
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.conf.ens3.bc_forwarding = 0
net.ipv4.conf.ens3.forwarding = 0
net.ipv4.conf.ens3.mc_forwarding = 0
net.ipv4.conf.lo.bc_forwarding = 0
net.ipv4.conf.lo.forwarding = 0
net.ipv4.conf.lo.mc_forwarding = 0
net.ipv4.conf.tun0.bc_forwarding = 0
net.ipv4.conf.tun0.forwarding = 0
net.ipv4.conf.tun0.mc_forwarding = 0
net.ipv4.ip_forward = 0
net.ipv4.ip_forward_update_priority = 1
net.ipv4.ip_forward_use_pmtu = 0
net.ipv6.conf.all.forwarding = 0
net.ipv6.conf.all.mc_forwarding = 0
net.ipv6.conf.default.forwarding = 0
net.ipv6.conf.default.mc_forwarding = 0
net.ipv6.conf.ens3.forwarding = 0
net.ipv6.conf.ens3.mc_forwarding = 0
net.ipv6.conf.lo.forwarding = 0
net.ipv6.conf.lo.mc_forwarding = 0
net.ipv6.conf.tun0.forwarding = 0
net.ipv6.conf.tun0.mc_forwarding = 0

[root на mail ~]# sysctl --system

[root на mail ~]# sysctl -a | grep forward
net.ipv4.conf.all.bc_forwarding = 0
net.ipv4.conf.all.forwarding = 1
net.ipv4.conf.all.mc_forwarding = 0
net.ipv4.conf.default.bc_forwarding = 0
net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.conf.ens3.bc_forwarding = 0
net.ipv4.conf.ens3.forwarding = 1
net.ipv4.conf.ens3.mc_forwarding = 0
net.ipv4.conf.lo.bc_forwarding = 0
net.ipv4.conf.lo.forwarding = 1
net.ipv4.conf.lo.mc_forwarding = 0
net.ipv4.conf.tun0.bc_forwarding = 0
net.ipv4.conf.tun0.forwarding = 1
net.ipv4.conf.tun0.mc_forwarding = 0
net.ipv4.ip_forward = 1
net.ipv4.ip_forward_update_priority = 1
net.ipv4.ip_forward_use_pmtu = 0
net.ipv6.conf.all.forwarding = 0
net.ipv6.conf.all.mc_forwarding = 0
net.ipv6.conf.default.forwarding = 0
net.ipv6.conf.default.mc_forwarding = 0
net.ipv6.conf.ens3.forwarding = 0
net.ipv6.conf.ens3.mc_forwarding = 0
net.ipv6.conf.lo.forwarding = 0
net.ipv6.conf.lo.mc_forwarding = 0
net.ipv6.conf.tun0.forwarding = 0
net.ipv6.conf.tun0.mc_forwarding = 0

-- 
Станислав Дёгтев
Служба "Ваш админ"
 Мои контакты:
 - email: stas.grumbler на gmail.com и stas на vashadmin.su
 - телефоны в Е-бурге +79045430461, +79222112259, +79505571146, +79193628944



Подробная информация о списке рассылки community