Unix Technical Forum

Routing on 1 ethernet card possible?

This is a discussion on Routing on 1 ethernet card possible? within the Gentoo Linux Support forums, part of the Unix Operating Systems category; --> I have a compact machine, which can be physically equipped with only one ethernet controler (no usb-ethernet possible since ...


Go Back   Unix Technical Forum > Unix Operating Systems > Gentoo Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2008, 10:32 AM
Mack Maverick
 
Posts: n/a
Default Routing on 1 ethernet card possible?

I have a compact machine, which can be physically equipped with only one
ethernet controler (no usb-ethernet possible since it doesn't support
usb. I'm thinking about converting it into a "home-use router/web
testing server" becouse it consumes the same amount of power as a
lightbulb :P

The question is - can I route the signal from my ISP using this machine
with one ethernet controller, a switch and miles of the ethernet cable?

i'd be grateful for any hint

MM
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-21-2008, 10:32 AM
Matt Klink
 
Posts: n/a
Default Re: Routing on 1 ethernet card possible?

Mack Maverick wrote:
> The question is - can I route the signal from my ISP using this machine
> with one ethernet controller, a switch and miles of the ethernet cable?

concerning ADSL it is possible. the DSL data the modem sends is no IP
based. so hook yr DSL modem directly to the switch and hook the router
to the switch, too.
it's not the optimal way but it sure works.

if somehow u really need to have a second IP simply put an alias on eth0.


HTH
Matt
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-21-2008, 10:32 AM
=?UTF-8?B?UGF3ZcWC?= Kraszewski
 
Posts: n/a
Default Re: Routing on 1 ethernet card possible?

Mack Maverick wrote:

> The question is - can I route the signal from my ISP using this machine
> with one ethernet controller, a switch and miles of the ethernet cable?


I did it once, as a proof-of-concept - routing between two networks shared
on a single wire.

1. You need to configure the computer to have access to ISP.
2. Add an IP alias to the eth card with non-conflicting private address (one
of 10.x.x.x, 192.168.x.x or 172.16.x.x). The card should have TWO IPs
from now on
3. Enable FORWARDING. This should toss packets between nets.
4. Setup MASQUARADE (for dynamic ISP IP) or SNAT (for static ISP IP) working
that way:

Masquarade/NAT packets coming from local network going out via eth0.

Example for static IP:

iptables -t nat -A POSTROUTING -s YOUR-PRIVATE-NETWORK -o YOUR_NIC
-j SNAT --to-source YOUR-IP-AT-ISP

HTH
--
Pawel Kraszewski
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-21-2008, 10:32 AM
Moe Trin
 
Posts: n/a
Default Re: Routing on 1 ethernet card possible?

In the Usenet newsgroup alt.os.linux.gentoo, in article
<dhj0hg$3pj$1@nemesis.news.tpi.pl>, Mack Maverick wrote:

>I have a compact machine, which can be physically equipped with only one
>ethernet controler (no usb-ethernet possible since it doesn't support
>usb. I'm thinking about converting it into a "home-use router/web
>testing server" becouse it consumes the same amount of power as a
>lightbulb :P


I have light bulbs from 4 Watts to 250 Watts in normal use, and there is
a 400 Watt security light that is occasionally used. That's a pretty
large spread. ;-)

Look at the newsgroup 'comp.os.linux.networking' for a thread titled
"Router Recommendations" where we discuss the relative costs. Briefly,
I use an old 386SX-16 that was once a laptop, without a display or
keyboard, and it takes about 30 VA. For a year, that's 263 KWH, and
costs about US$19.30 a year. If you have a 150 Watt desktop, the
consumption would be five times higher - 1315 KWH and in my case
US$96.50.

>The question is - can I route the signal from my ISP using this machine
>with one ethernet controller, a switch and miles of the ethernet cable?


From a security standpoint, the key is the switch. This will separate
the local packets from those for the ISP at only a minor loss of
bandwidth. The drawback is that the broadcast packets may still make
it through the switch, and seeing this traffic may annoy the ISP.
It would be better to use two NICs, but this can work. At the same time,
as a personal opinion - I do not like to run anything except the firewall
code on the firewall. Extra code running is extra code that _could_ be
exploited.

Old guy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-21-2008, 10:35 AM
ken
 
Posts: n/a
Default Re: Routing on 1 ethernet card possible?

Mack Maverick wrote:

> I have a compact machine, which can be physically equipped with only one
> ethernet controler (no usb-ethernet possible since it doesn't support
> usb. I'm thinking about converting it into a "home-use router/web
> testing server" becouse it consumes the same amount of power as a
> lightbulb :P
>
> The question is - can I route the signal from my ISP using this machine
> with one ethernet controller, a switch and miles of the ethernet cable?
>
> i'd be grateful for any hint
>
> MM

If your computer has ANY available pci slots (is your ethernet on a pci
card or built into the motherboard?) there ARE dual network pci cards
made (but not cheap) so maybe you could do that if you really need separate
physical networks.

The alias IP suggestions on a single network port made by others will work
(I didn't know about that...learn something new everyday!).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:34 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com