View previous topic :: View next topic |
Author |
Message |
onineko n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 31 Mar 2005 Posts: 68
|
Posted: Tue Mar 18, 2008 8:38 am Post subject: building a router with only 1 nic? |
|
|
Hello!
I'm replacing my trusty old router/server-box with a new one, that has more power but less space (go shuttle!).
Theoretically it would be possible to put in a second nic, but it would put up some problems that i'd rather not have. So i'm asking: what do i have to do, to get this router working with only one nic? I'm thinking something like: the ppp-connection is it's own beast(virtual interface) that gets created when the router connects (adsl-setup, or should i use something else in this case?), the eth0 can stay the same(ip of the internal net, etc). The workstations in the internal net get the eth0-ip as gateway, and iptables forwards the incoming/outgoing traffic between eth0 and ppp?
is there a howto somewhere or could any of you put some definite points here, because so far this is just "an idea that might work kinda like that" and i'm lacking some points that are more exact, to wrap it around =)
thank you for any answers you might have^^
onineko |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
di1bert l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/1322078658465db3da4a87f.gif)
Joined: 16 May 2002 Posts: 963 Location: Oslo, Norway
|
Posted: Tue Mar 18, 2008 10:16 am Post subject: |
|
|
Easy peasy...just use pppoe for the ppp link...
Here's an example conf.d/net we use alot...
Code: |
config_ppp0=( "ppp" )
link_ppp0="eth1"
plugins_ppp0=( "pppoe" )
username_ppp0="user@adslserver.com"
password_ppp0="password"
pppd_ppp0=( "updetach"
"defaultroute"
)
RC_NEED_ppp0="net.eth1"
|
Also you may want to check this out. It's a very good guide....
HTH
-m |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
snIP3r l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 21 May 2004 Posts: 853 Location: germany
|
Posted: Tue Mar 18, 2008 11:32 am Post subject: |
|
|
hi!
i am not so sure if this might work - but these are only my thoughts... the link di1bert posted is the howto for 2 physical nics.
if you want to use only one nic you should use virtual devices (unfortunately i have no experience with this). so eth0 is "splitted" into eth0:0 and eth0:1. these device can than be used for further config. but i still do not know how you want to realize the wiring? one switch for both the dsl/cable modem and the other internal network hosts...
HTH
snIP3r _________________ Intel i3-4130T on ASUS P9D-X
Kernel 5.15.88-gentoo SMP
-----------------------------------------------
if your problem is fixed please add something like [solved] to the topic! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
onineko n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 31 Mar 2005 Posts: 68
|
Posted: Tue Mar 18, 2008 12:19 pm Post subject: |
|
|
yeah, i'm a bit lost, too, because the howto uses 2 nics.
the wiring would be like that:
routerbox - <switch> - [dsl-modem] - (internet)
other pcs - ^
i know, it's not exactly neat or clean, theoretically the other pcs could still dial in directly with the modem, but the way it'l be used is, that i give the 2 technophobic users the gateway ip (routerbox) and the stuff will not be touched by them ^^;
unfortunately i didn't really find anything explicit about the building of such a router..
in any case, thanks for the answers ^^
onineko |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
snIP3r l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 21 May 2004 Posts: 853 Location: germany
|
Posted: Tue Mar 18, 2008 3:01 pm Post subject: |
|
|
hi onineko!
i also thought about the wiring you posted - ok, this is the only possible solution theoretically you have to build 2 virtual nics based on the physical, and with that, you can go on with the router howto using the two nics. the only difference is that you have two virtual and not physical nics.
you might create a virutal nic with this command
Code: |
ifconfig eth0:1 <ip> <subnet> <gateway>
|
i am not sure if this works, you can also consult the ifconfig manpage for creating virtual nics...
HTH
snIP3r _________________ Intel i3-4130T on ASUS P9D-X
Kernel 5.15.88-gentoo SMP
-----------------------------------------------
if your problem is fixed please add something like [solved] to the topic! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|