Consultar se ativado
$ sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 0
ou
$ cat /proc/sys/net/ipv4/ip_forward
0
Habilitar de forma volátil
$ sysctl -w net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1
ou
$ echo 1 > /proc/sys/net/ipv4/ip_forward
Habilitar de forma perene
echo net.ipv4.ip_forward = 1 >> /etc/sysctl.conf
ou
sysctl -p /etc/sysctl.conf
Aplicar a configuração
RedHat-Like
service network restart
Debian-Like
/etc/init.d/procps.sh restart
configuração através do script específico da distribuição
RedHat-Like
# /etc/sysconfig/network
FORWARD_IPV4=true
Debian-Like
# vim /etc/network/options
ip_forward=no
Referências
http://www.ducea.com/2006/08/01/how-to-enable-ip-forwarding-in-linux/
Comentários