Networking Forums

Networking Forums > Computer Networking > Linux Networking > Gateway using a single NIC

Reply
Thread Tools Display Modes

Gateway using a single NIC

 
 
Mats Byggmastar
Guest
Posts: n/a

 
      11-11-2004, 08:13 PM

Hi!

Is it possible to set up a Linux machine with a single NIC to act
as a "fake gateway" inside a LAN?

The LAN already have a real gateway to internet, but I'd like
the "fake gateway" to sit on the LAN, and all packets towards
internet should first have to pass through the "fake gateway".
In the "fake gateway" I could then have filter rules that allows
me to control which hosts on the LAN can access internet.
And this is the purpose of all this, to be able to block internet
access for selected hosts on the LAN. I don't want to make any
physical changes to the network. I just want to add this "fake
gateway" and configure the hosts to point to it, instead of the
real one.

I've browsed through various Linux networking docs and howtos
but I'm too newbie at this... can anyone give me any hints?


Any help appreciated.

Mats







 
Reply With Quote
 
 
 
 
James Knott
Guest
Posts: n/a

 
      11-11-2004, 09:28 PM
Mats Byggmastar wrote:

>
> Hi!
>
> Is it possible to set up a Linux machine with a single NIC to act
> as a "fake gateway" inside a LAN?
>
> The LAN already have a real gateway to internet, but I'd like
> the "fake gateway" to sit on the LAN, and all packets towards
> internet should first have to pass through the "fake gateway".
> In the "fake gateway" I could then have filter rules that allows
> me to control which hosts on the LAN can access internet.
> And this is the purpose of all this, to be able to block internet
> access for selected hosts on the LAN. I don't want to make any
> physical changes to the network. I just want to add this "fake
> gateway" and configure the hosts to point to it, instead of the
> real one.
>
> I've browsed through various Linux networking docs and howtos
> but I'm too newbie at this... can anyone give me any hints?


It won't work. When Linux determines that both sides are on the same wire,
it will send an ICMP redirect, telling the computer to talk directly to the
modem etc. Remember, local communications don't use an IP. They use a mac
address, so your firewall will become invisible.

 
Reply With Quote
 
Jason Clark
Guest
Posts: n/a

 
      11-12-2004, 04:01 AM
Can you use .1q vlans? If you can, you can make that one interface look
like several interfaces and then do what you want. Setup a trunk from your
switch to the fake gateway trunking a vlan from your clients to the
fake gateway and then a second vlan from the fake gateway connected to
the real gateway. Just make sure that the subnet between the fake gateway
and the real gateway is different then the subnet between the fake gateway
and the hosts. You'll need to select .1q trunking in your linux kernel
config and download the vconfig user tools in order to create your vlan
interfaces.

On Thu, 11 Nov 2004 23:13:11 +0200, Mats Byggmastar wrote:

>
> Hi!
>
> Is it possible to set up a Linux machine with a single NIC to act
> as a "fake gateway" inside a LAN?
>
> The LAN already have a real gateway to internet, but I'd like
> the "fake gateway" to sit on the LAN, and all packets towards
> internet should first have to pass through the "fake gateway".
> In the "fake gateway" I could then have filter rules that allows
> me to control which hosts on the LAN can access internet.
> And this is the purpose of all this, to be able to block internet
> access for selected hosts on the LAN. I don't want to make any
> physical changes to the network. I just want to add this "fake
> gateway" and configure the hosts to point to it, instead of the
> real one.
>
> I've browsed through various Linux networking docs and howtos
> but I'm too newbie at this... can anyone give me any hints?
>
>
> Any help appreciated.
>
> Mats


 
Reply With Quote
 
Mats Byggmastar
Guest
Posts: n/a

 
      11-12-2004, 01:46 PM

"James Knott" <(E-Mail Removed)> wrote in message news:7P-dnQRSK5ITeg7cRVn-(E-Mail Removed)...
>
> It won't work. When Linux determines that both sides are on the same wire,
> it will send an ICMP redirect, telling the computer to talk directly to the
> modem etc. Remember, local communications don't use an IP. They use a mac
> address, so your firewall will become invisible.


OK.

I found a bridge/firewall setup at http://www.shorewall.net
If I understood it correctly, a bridge basically works as a
switch inside the LAN. So with a bridge I would not even have
to reconfigure the hosts on the LAN, just stick the bridge
in between somewhere. And if the bridge stops working for some
reason, (or some admin doesn't like it,) it can simply be
unplugged and bypassed with a cable.


Mats




 
Reply With Quote
 
James Knott
Guest
Posts: n/a

 
      11-12-2004, 02:06 PM
Mats Byggmastar wrote:

>
> "James Knott" <(E-Mail Removed)> wrote in message
> news:7P-dnQRSK5ITeg7cRVn-(E-Mail Removed)...
>>
>> It won't work. When Linux determines that both sides are on the same
>> wire, it will send an ICMP redirect, telling the computer to talk
>> directly to the
>> modem etc. Remember, local communications don't use an IP. They use a
>> mac address, so your firewall will become invisible.

>
> OK.
>
> I found a bridge/firewall setup at http://www.shorewall.net
> If I understood it correctly, a bridge basically works as a
> switch inside the LAN. So with a bridge I would not even have
> to reconfigure the hosts on the LAN, just stick the bridge
> in between somewhere. And if the bridge stops working for some
> reason, (or some admin doesn't like it,) it can simply be
> unplugged and bypassed with a cable.


Whatever you use, you'll still need two NICs in it.

 
Reply With Quote
 
James Knott
Guest
Posts: n/a

 
      11-12-2004, 02:08 PM
Jason Clark wrote:

> Can you use .1q vlans?**If*you*can,*you*can*make*that*one*interface*look
> like several interfaces and then do what you want. Setup a trunk from your
> switch to the fake gateway trunking a vlan from your clients to the
> fake gateway and then a second vlan from the fake gateway connected to
> the real gateway. Just make sure that the subnet between the fake gateway
> and the real gateway is different then the subnet between the fake gateway
> and the hosts.**You'll*need*to*select*.1q*trunking*in*your*linux*kernel
> config and download the vconfig user tools in order to create your vlan
> interfaces.


If you try to use the same interface for two IPs, ICMP redirects will cause
the the "gateway" to be ignored.

 
Reply With Quote
 
Mats Byggmastar
Guest
Posts: n/a

 
      11-12-2004, 02:30 PM

"James Knott" <(E-Mail Removed)> wrote in message news:7oSdnX2aEMriTAncRVn-(E-Mail Removed)...
> Mats Byggmastar wrote:
>
> >
> > "James Knott" <(E-Mail Removed)> wrote in message
> > news:7P-dnQRSK5ITeg7cRVn-(E-Mail Removed)...
> >>
> >> It won't work. When Linux determines that both sides are on the same
> >> wire, it will send an ICMP redirect, telling the computer to talk
> >> directly to the
> >> modem etc. Remember, local communications don't use an IP. They use a
> >> mac address, so your firewall will become invisible.

> >
> > OK.
> >
> > I found a bridge/firewall setup at http://www.shorewall.net
> > If I understood it correctly, a bridge basically works as a
> > switch inside the LAN. So with a bridge I would not even have
> > to reconfigure the hosts on the LAN, just stick the bridge
> > in between somewhere. And if the bridge stops working for some
> > reason, (or some admin doesn't like it,) it can simply be
> > unplugged and bypassed with a cable.

>
> Whatever you use, you'll still need two NICs in it.


Yes.
This bridge thing has two NICs, but the LAN don't have to be
reorganised in a dramatic way so it should be ok for me.


Mats



 
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
Multiple gateway on single nic question Marcus Dempsey Windows Networking 2 03-04-2008 11:02 PM
Single xp computer can't connect to a single server groups@brainin.com Windows Networking 0 09-12-2007 10:38 PM
Is a single-port ADSL router the same as a single-port ethernet modem? Graeme Allen Broadband 8 01-26-2004 10:55 PM
Can a Single Building-to-Building Bridge be used as a Single Access Point? Alan Wireless Internet 0 10-28-2003 09:27 PM
Windows98 Gateway will not accept static gateway Steve Windows Networking 2 09-21-2003 05:45 AM



1 2 3 4 5 6 7 8 9 10 11