- IP Forwarding problems.

PDA

View Full Version : IP Forwarding problems.


Nuno Paquete
07-25-2004, 01:36 AM
Hi group.
I've compiled kernel 2.6.4 and everything is working fine, except IP
forwarding.
My internal hosts can't get access to Internet because ip forwarding is not
working.
I've compiled kernel with "IP: advanced router (CONFIG_IP_ADVANCED_ROUTER)"
built-in.
I've look for /proc/sys/net/ipv4/ip_forward but this file doesn't exist.

Can anyone help me?

Nuno Paquete.

Dan McDaid
07-25-2004, 01:36 AM
You don't actually need to compile in the IP: advanced router. It has a few
extra functions that you most likely don't need.

echo "1" > /proc/sys/net/ipv4/ip_forward

should enable ip forwarding.
You should put this in your firewall script.

Dan


"Nuno Paquete" <nmp@ispgaya.pt> wrote in message
news:40e1b0fe$0$5826$a729d347@news.telepac.pt...
> Hi group.
> I've compiled kernel 2.6.4 and everything is working fine, except IP
> forwarding.
> My internal hosts can't get access to Internet because ip forwarding is
not
> working.
> I've compiled kernel with "IP: advanced router
(CONFIG_IP_ADVANCED_ROUTER)"
> built-in.
> I've look for /proc/sys/net/ipv4/ip_forward but this file doesn't exist.
>
> Can anyone help me?
>
> Nuno Paquete.

Dan McDaid
07-25-2004, 01:36 AM
I was assuming you have a firewall script and have set up some sort of
forwarding policy?

Dan

"Dan McDaid" <no@email.com> wrote in message
news:VziEc.2636$a37.908@fe2.news.blueyonder.co.uk...
> You don't actually need to compile in the IP: advanced router. It has a
few
> extra functions that you most likely don't need.
>
> echo "1" > /proc/sys/net/ipv4/ip_forward
>
> should enable ip forwarding.
> You should put this in your firewall script.
>
> Dan
>
>
> "Nuno Paquete" <nmp@ispgaya.pt> wrote in message
> news:40e1b0fe$0$5826$a729d347@news.telepac.pt...
> > Hi group.
> > I've compiled kernel 2.6.4 and everything is working fine, except IP
> > forwarding.
> > My internal hosts can't get access to Internet because ip forwarding is
> not
> > working.
> > I've compiled kernel with "IP: advanced router
> (CONFIG_IP_ADVANCED_ROUTER)"
> > built-in.
> > I've look for /proc/sys/net/ipv4/ip_forward but this file doesn't exist.
> >
> > Can anyone help me?
> >
> > Nuno Paquete.
>
>

Bit Twister
07-25-2004, 01:36 AM
On Tue, 29 Jun 2004 18:58:05 +0100, Nuno Paquete wrote:
> Hi group.
> I've compiled kernel 2.6.4 and everything is working fine, except IP
> forwarding.

Please read http://www.catb.org/~esr/faqs/smart-questions.html
Always provide which distro and release level, helps you get better
answers.

On Mandrake 9 and 10 you set
net.ipv4.ip_forward = 1 in /etc/sysctl.conf
before that you placed FORWARD_IPV4=yes in /etc/sysconfig/network

If you modify /etc/sysctl.conf you need to reload it with sysctl -p
You will need to add postrouting masquerade and forward rules to the
masquerading's hosts firewall.

Clifford Kite
07-25-2004, 01:36 AM
Bit Twister <BitTwister@localhost.localdomain> wrote:
> On Tue, 29 Jun 2004 18:58:05 +0100, Nuno Paquete wrote:
>> Hi group.
>> I've compiled kernel 2.6.4 and everything is working fine, except IP
>> forwarding.

> Please read http://www.catb.org/~esr/faqs/smart-questions.html
> Always provide which distro and release level, helps you get better
> answers.

I don't believe he needs to read that at all. :)

-- Clifford Kite Email: "echo xvgr_yvahk-ccc@ri1.arg|rot13"
PPP-Q&A links, downloads: http://ckite.no-ip.net/
/* They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." Benjamin Franklin */

Clifford Kite
07-25-2004, 01:36 AM
Nuno Paquete <nmp@ispgaya.pt> wrote:
> Hi group.
> I've compiled kernel 2.6.4 and everything is working fine, except
> IP forwarding. My internal hosts can't get access to Internet
> because ip forwarding is not working. I've compiled kernel with "IP:
> advanced router (CONFIG_IP_ADVANCED_ROUTER)" built-in. I've look
> for /proc/sys/net/ipv4/ip_forward but this file doesn't exist.

That configuration option is not the one you use to get ip_forward.

There is, however, a hint as to what's needed for ip_forward in the
help for that option (but not worded too well). If you have a /proc
filesystem then that's half of what's needed. The other thing you
need is found in the sub-section

General setup

of the main menu (assuming "make menuconfig"):

Sysctl support

--
Clifford Kite Email: "echo xvgr_yvahk-ccc@ri1.arg|rot13"
PPP-Q&A links, downloads: http://ckite.no-ip.net/
/* Speak softly and carry a +6 two-handed sword. */

Nuno Paquete
07-25-2004, 01:36 AM
Dan McDaid wrote:

> I was assuming you have a firewall script and have set up some sort of
> forwarding policy?

Yes I do (iptables).

> echo "1" > /proc/sys/net/ipv4/ip_forward
>
> should enable ip forwarding.
> You should put this in your firewall script.

I can't do that.
The file must exists before execute that command, and i can't create that
file, I don't know why. I've made:

chmod 755 /proc
cd /proc
mkdir sys

but i receive a permission denied message.
It seams that is not possible to write to that folder, even logged as root.

I've got Slackware 9.1 installed.
Any more ideas?

Regards,
Nuno Paquete.

Dan McDaid
07-25-2004, 01:36 AM
Ah well. At least if I get it wrong people can correct my mistakes.
You learn somthing new every day if you make the effort!
:-)

Cheers
Dan

"Nuno Paquete" <nmp@ispgaya.pt> wrote in message
news:40e1b0fe$0$5826$a729d347@news.telepac.pt...
> Hi group.
> I've compiled kernel 2.6.4 and everything is working fine, except IP
> forwarding.
> My internal hosts can't get access to Internet because ip forwarding is
not
> working.
> I've compiled kernel with "IP: advanced router
(CONFIG_IP_ADVANCED_ROUTER)"
> built-in.
> I've look for /proc/sys/net/ipv4/ip_forward but this file doesn't exist.
>
> Can anyone help me?
>
> Nuno Paquete.

Nuno Paquete
07-25-2004, 01:36 AM
Bit Twister wrote:

> On Tue, 29 Jun 2004 18:58:05 +0100, Nuno Paquete wrote:
>> Hi group.
>> I've compiled kernel 2.6.4 and everything is working fine, except IP
>> forwarding.
>
> Please read http://www.catb.org/~esr/faqs/smart-questions.html
> Always provide which distro and release level, helps you get better
> answers.
>
> On Mandrake 9 and 10 you set
> net.ipv4.ip_forward = 1 in /etc/sysctl.conf
> before that you placed FORWARD_IPV4=yes in /etc/sysconfig/network
>
> If you modify /etc/sysctl.conf you need to reload it with sysctl -p
> You will need to add postrouting masquerade and forward rules to the
> masquerading's hosts firewall.

I'm using Slackware 9.1.

Nuno Paquete
07-25-2004, 01:36 AM
Clifford Kite wrote:

> Nuno Paquete <nmp@ispgaya.pt> wrote:
>> Hi group.
>> I've compiled kernel 2.6.4 and everything is working fine, except
>> IP forwarding. My internal hosts can't get access to Internet
>> because ip forwarding is not working. I've compiled kernel with "IP:
>> advanced router (CONFIG_IP_ADVANCED_ROUTER)" built-in. I've look
>> for /proc/sys/net/ipv4/ip_forward but this file doesn't exist.
>
> That configuration option is not the one you use to get ip_forward.
>
> There is, however, a hint as to what's needed for ip_forward in the
> help for that option (but not worded too well). If you have a /proc
> filesystem then that's half of what's needed. The other thing you
> need is found in the sub-section
>
> General setup
>
> of the main menu (assuming "make menuconfig"):
>
> Sysctl support
>

That's it.
It was missing that.
It's working perfectly.
Thank you all.

Nuno Paquete.

Andrew Keith
07-25-2004, 01:36 AM
mkdir sys ?

you should not be creating anything within the /proc directory. I suggest
you
rebuild your kernel and test the /proc. I think its a kernel problem because
you should have /proc/sys/net/ipv4

Andrew

"Nuno Paquete" <nmp@ispgaya.pt> wrote in message
news:40e1d02e$0$5863$a729d347@news.telepac.pt...
> Dan McDaid wrote:
>
> > I was assuming you have a firewall script and have set up some sort of
> > forwarding policy?
>
> Yes I do (iptables).
>
> > echo "1" > /proc/sys/net/ipv4/ip_forward
> >
> > should enable ip forwarding.
> > You should put this in your firewall script.
>
> I can't do that.
> The file must exists before execute that command, and i can't create that
> file, I don't know why. I've made:
>
> chmod 755 /proc
> cd /proc
> mkdir sys
>
> but i receive a permission denied message.
> It seams that is not possible to write to that folder, even logged as
root.
>
> I've got Slackware 9.1 installed.
> Any more ideas?
>
> Regards,
> Nuno Paquete.
>

Juhan Leemet
07-25-2004, 01:37 AM
On Wed, 30 Jun 2004 18:01:38 +0800, Andrew Keith wrote:
> you should not be creating anything within the /proc directory. I suggest
> you rebuild your kernel and test the /proc. I think its a kernel problem
> because you should have /proc/sys/net/ipv4

I'm surprised that he can, if he can. /proc is a virtual directory, owned
and populated by the kernel. You will notice that pretty well everything
in there is read only? It is "written" by the kernel. The /proc mechanism
is a way of reporting internal status in text form. Any changes should
really be made by system calls, from the appropriate configuration
tool(s). It's not a "real" file system.

/proc is sort of like /home when that is owned by the automounter.

--
Juhan Leemet
Logicognosis, Inc.

Clifford Kite
07-25-2004, 01:37 AM
Juhan Leemet <juhan@logicognosis.com> wrote:
> On Wed, 30 Jun 2004 18:01:38 +0800, Andrew Keith wrote:
>> you should not be creating anything within the /proc directory. I suggest
>> you rebuild your kernel and test the /proc. I think its a kernel problem
>> because you should have /proc/sys/net/ipv4

> I'm surprised that he can, if he can. /proc is a virtual directory, owned
> and populated by the kernel. You will notice that pretty well everything
> in there is read only? It is "written" by the kernel. The /proc mechanism
> is a way of reporting internal status in text form. Any changes should
> really be made by system calls, from the appropriate configuration
> tool(s). It's not a "real" file system.

He can write to it, so you're surprised. Parts are designed especially
so root can change settings for the kernel. Someone really should create
an equivalent FAQ to ESR's "smart questions" FAQ, entitled "good answers."

-- Clifford Kite Email: "echo xvgr_yvahk-ccc@ri1.arg|rot13"
PPP-Q&A links, downloads: http://ckite.no-ip.net/
/* The signal-to-noise ratio is too low in many [news] groups to make
* them good candidates for archiving.
* --- Mike Moraes, Answers to FAQs about Usenet */