# enable IP forwarding "Iptables" [solved]

## XenoTerraCide

ok I just spent the last 2 hours trying to figure out why my laptop couldn't access the outside world. only to find that 

```
/proc/sys/net/ipv4/conf/all/forwarding
```

 had a 0 in it. according to a walkthrough in the gentoo-wiki. 

```
ENABLE_FORWARDING_IPv4="yes"
```

 having that in the /etc/conf.d/iptables file should auto set the forwarding to one but it must not or something else weird happened... possible... anyway. what's the appropriate way to get that set to one on startup?

----------

## desultory

```
echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
```

----------

## XenoTerraCide

yeah I got that. I did that. I mean if I restart for some reason. I assumed I didn't have to do that every time. and I don't want to have to remember to do it cause I doubt I reboot once a week now and am in the process of making pretty much everything automated. to quote from the ten commandment's of system administration from newsforge.com  *Quote:*   

> X. Thou shalt not waste time doing repetitive and mundane tasks

 

----------

## desultory

Speak to me not of commandments.

I have heard the teachings of the prophet Wall.

I have embraced the three Cardinal Virtues.

Heed now the words of the good book (really a man page, somewhat paraphrased).

In the beginning there is the Kernel.

And the Kernel shall invoke init.

And init shall invoke the init scripts.

And of these one shall be called local.

And local shall be held as blessed, 

for local shall handle the mundane 

and local shall attend the repetitive.Last edited by desultory on Mon Jan 16, 2006 4:03 am; edited 1 time in total

----------

## XenoTerraCide

eh...? what man page... I'm confused now... I really don't understand that kind of english well. thanks for turning my quote against me...

----------

## desultory

Just put 'echo 1 > /proc/sys/net/ipv4/conf/all/forwarding' in the start function of /etc/init.d/local and it should work fine.  I suggest you comment it out (or remove it) when you do a major update, so that you can see if the problem goes away.

----------

## XenoTerraCide

thx.

----------

## shazow

 *desultory wrote:*   

> Speak to me not of commandments.
> 
> I have heard the teachings of the prophet Wall.
> 
> I have embraced the three Cardinal Virtues.
> ...

 

Heehee! That made my night. Thanks desultory.  :Very Happy: 

- shazow

----------

## XenoTerraCide

according to this gentoo doc... http://www.gentoo.org/doc/en/home-router-howto.xmlmust be new I don't recall having seen it before. I should

```
# nano /etc/sysctl.conf

Add/Uncomment the following lines:

net.ipv4.ip_forward = 1

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

----------

## desultory

Looks good, go for it.

Three guesses what I though was not working for you.

----------

