Networking Forums

Networking Forums > Computer Networking > Linux Networking > simple question about ip_forward and NAT routing.

Reply
Thread Tools Display Modes

simple question about ip_forward and NAT routing.

 
 
meneg
Guest
Posts: n/a

 
      03-30-2005, 07:16 PM
Hi, I have a simple question for some time now. If ip_forward is ON on a
machine, is every computer on the same subnet able to get it to be its
default gateway and get bandwidth from it (e.g. from an internet
connection that machine has for its own), when the purpose was for example
to plug in a laptop? Yes, No? If yes, what's the way to exclude all the
other machines without doing any weird routing that cuts them off
completely? thanks.
 
Reply With Quote
 
 
 
 
Jose Maria Lopez Hernandez
Guest
Posts: n/a

 
      03-30-2005, 07:36 PM
meneg wrote:
> Hi, I have a simple question for some time now. If ip_forward is ON on a
> machine, is every computer on the same subnet able to get it to be its
> default gateway and get bandwidth from it (e.g. from an internet
> connection that machine has for its own), when the purpose was for example
> to plug in a laptop? Yes, No? If yes, what's the way to exclude all the
> other machines without doing any weird routing that cuts them off
> completely? thanks.


Yes, if you have ip_forward activated any machine that can route
traffic to the server can use it as a gateway. If the server it's
acting as a NAT router then the traffic will be NATed and the machine
can access the internet.

The way to stop this behaviour it's very easy. Just use some iptables
rules to allow only traffic for the hosts you want in the FORWARD
chain or if you are using SNAT or MASQUERADE just do it for the IPs
you want. You can do it also in other manner, allow all the traffic
from the subnet and DROP the packets in the FORWARD chain for the
machines you don't want to have access to Internet.

You can even use the iproute2 funcionality and the ip command to
add some rules for source routing, and allow only to route the
packets to the net from the host you want.

As you can see you have quite a lot of approaches to the problem.

Regards.

--

Jose Maria Lopez Hernandez
Director Tecnico de bgSEC
(E-Mail Removed)
bgSEC Seguridad y Consultoria de Sistemas Informaticos
http://www.bgsec.com
ESPAÑA

The only people for me are the mad ones -- the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn, burn
like fabulous yellow Roman candles.
-- Jack Kerouac, "On the Road"
 
Reply With Quote
 
meneg
Guest
Posts: n/a

 
      03-31-2005, 03:16 AM
On Wed, 30 Mar 2005 21:36:31 +0200, Jose Maria Lopez Hernandez wrote:

thanks for the response, it's very helpfull.

about this..

> any machine that can route traffic to the server


forgive my ignorance, I'm only using the functionality to share an
internet connection with a laptop but which are the machines that can
"route traffic to the server"? that excludes the rest of the internet
or/and other subnets in the LAN?
 
Reply With Quote
 
Jose Maria Lopez Hernandez
Guest
Posts: n/a

 
      03-31-2005, 08:55 AM
meneg wrote:
> On Wed, 30 Mar 2005 21:36:31 +0200, Jose Maria Lopez Hernandez wrote:
>
> thanks for the response, it's very helpfull.
>
> about this..
>
>
>>any machine that can route traffic to the server

>
>
> forgive my ignorance, I'm only using the functionality to share an
> internet connection with a laptop but which are the machines that can
> "route traffic to the server"? that excludes the rest of the internet
> or/and other subnets in the LAN?



I meant the machines that can send traffic to the server (the router),
if a machine it's in the same subnet then it can send traffic to the
router, and if the router has ip_forward activated then it can be
forwarded to other networks connected to the router, for example the
Internet. If the machine is in other subnet usally it can't send traffic
to the router. So: if the machine can connect to the router it can use
it to forward traffic, if it cannot then it cannot use it as a gateway.

Regards.

--

Jose Maria Lopez Hernandez
Director Tecnico de bgSEC
(E-Mail Removed)
bgSEC Seguridad y Consultoria de Sistemas Informaticos
http://www.bgsec.com
ESPAÑA

The only people for me are the mad ones -- the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn, burn
like fabulous yellow Roman candles.
-- Jack Kerouac, "On the Road"
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple routing question... Christian Williamson Linux Networking 5 07-18-2007 04:59 PM
simple lan routing BW Windows Networking 7 04-27-2007 02:56 AM
Simple (?) routing question Dario Linux Networking 1 11-23-2004 12:51 PM
Simple routing question about my setup Ken Williams Linux Networking 4 06-30-2004 11:07 PM
Help with simple routing calle Linux Networking 12 09-05-2003 02:01 PM



1 2 3 4 5 6 7 8 9 10 11