PDA

View Full Version : knoppix... gateway or router?



ghostblaze
10-31-2004, 09:42 AM
Hi there, I have a network at home, and I use a cable connection to access the internet. I have one computer that's running knoppix right now, and it has 3 nics on it.

cable modem---(eth2)---|Knoppix|---(eth0)---[uplink on router 1 (ovislink)]
--------------------------------| box |---(eth1)---[uplink on router 2 (dlink)]



I have 2 routers/hubs that have 1 uplink and 4 ports on them, (1 ovislink and 1 dlink) I was wondering if I could connect the modem to one of the nics on knoppix, and have the other two nics connected to the uplink on the routers. Basically so any pc connected to the router/s could access the internet, and each other if possible...

so how would I go about accomplishing this??? I know how to do it with windows, but I don't want to use windows. Any help or comments would be appreciated.

Harry Kuhman
10-31-2004, 10:16 AM
.....I have 2 routers/hubs that have 1 uplink and 4 ports on them, (1 ovislink and 1 dlink).....
First of all, routers are not hubs. Home DSL/Cable routers like the Dlink usually contain switches (although Linksys did make a one port home "router"), but there are important differences between switches and hubs too. So please spell out what you have, for each of the two devices, A router (with a switch built in), or a hub, or just a switch (yes, you can buy a dlink switch that doesn't have a router in it, so there is a big difference there.

Second of all, it's not clear why you spell out that your Knoppix system has multiple NICs and then you ask if you can just plug the PC into the router - it sure looked like you were about to ask if you could use the Knoppix system as a router.

If what you have are really routers with switches in them, then by all means you can use one to plug all of the computers into and access the Internet and each other that way. That's exactly what a home router is intended to do. I don't know anything about the ovislink (I like to check out all of the different home routers I can find, but never came across this one before), but I like the Dlink and it will certainly do the job. (After you get that working then you can swap in the other router and contrast the differences. There certainly will be some.) Plug only one of the NICs from the Knoppix system into the router, not all 3! And if you can figure out which one Knoppix thinks is eth0 when it boots, I would suggest using that one.

As to what you have to do, for accessing the Internet, here goes:
Plug the stuff together. Boot Knoppix (I'm assuming you're booting from CD). Use the browser that comes up when Knoppix boots (or another browser) to access the Internet. It's that easy. The router takes care of all connecting to the Internet issues, passwords and PPPoE if you're on DSL and the like. It gives your Knoppix system a local IP address by DHCP (just as it would if you had booted Windows). About the only thing you should have to do is basic setup of the router (if it isn't already set up and if it needs stuff like an ISP username and password). That's done by browsing to the IP address in the router manual (usually 192.168.something.1) And you might have to figure out which NIC Knoppix favors. I expect Knoppix might figure out which one is active, but I don't know, I've never booted Knoppix on a system with 3 NICS.

As for sharing files with the other computers on your local network, read over the other posts in this forum. It's been discussed many times.

If neither of the devices that you have are really routers but indeed are hubs or switches, then it's an entirely different issue. You likely can't just connect a hub or switch to your ethernet internet modem, but there are a few cases where you might get away with it. We would need details on the type of service and the make and model of modem to give you more information. But I'm hoping and expecting that will not be needed.

Harry Kuhman
10-31-2004, 10:29 AM
... if I could connect the modem to one of the nics on knoppix, and have the other two nics connected to the uplink on the routers. ....
If you have a home router, don't try doing it this way, just pick one of the routers and hook it to the cable modem and hook each PC to a port on the router.

If you end up with more than 4 computers, then you need to add a switch or hub to the system Some home cable routers let you disable the DHCP server and NAT routing and just use them as switches, some don't. You would need to look into what configuration options there are for each device. If you can't disable the router in either device you might still be able to use one to create a seperate sub-network with it's own NAT going on, but it would be ugly (although maybe no more ugly than trying to use Knoppix as a router). Best would be to add a switch. But you don't seem to have that many computers that need to be on the network at once yet.

ghostblaze
10-31-2004, 08:03 PM
http://nhlpatcherz.s5.com/topology.gif

:/ yeah, but I had that before... but I wanted to have it this way, I wanted to use knoppix.

(ps, the connections from the knoppix box to the routers' uplinks are cross wired cable... needed to be btw because the WLAN lights wouldn't light up, until I did that)

any ideas on how to use knoppix for this? I just need a quick tutorial or snippet on how to set up that knoppix box's iptable.

the knoppix box obviously connects to the net fine, the problem is giving the routers their EXTERNAL or UPLINK IPs. that's pretty much it....

the ovislink is an SR-500 , pretty nifty thing there, I can use standard cat 5 or crosswired cat 5 and it will still establish a connection, with the ported computer.

I realize this is kinda tough, but I know I could do it in M$ Win, just by bridging... BUT I like knoppix... and would rather use that, any help would be much appreciated seeing as time is not on my side.

Harry Kuhman
10-31-2004, 08:44 PM
The way you have it diagrammed (and now have your link working right :wink: ) you would really want switches in place of the two routers. I think some Linksys routers can have the router disabled and will effectively become a switch, but I don't think your Dlink can and have no information on the other brand. As long as they work as routers they will continue to do their own NAT. ARP and other protocols would not work between systems on the two different local networks You could never share files or other resources between a system on the 192.168.0.x network and the 192.168.1.x network. Anything you wanted to do between the systems would require that you set up port forwarding in each router, and since you can only forward any given port to one computer on the NAT network, you could never share most resources between more than one computer on each sub-net. Also, important traffic such as ARP would never be routed at all.

You already have the routers, it's not clear why you want to do this, except perhaps as a learning experience. There are other Linux distros made to server as firewalls and routers, some that just boot and run, even from a floppy. Clearly Knoppix can be configured to do this job too. But understand that all of the other systems become very dependent on the Knoppix box. If you reboot Knoppix you knock everyone off the network. And, of course, there are issues like the amount of power your Knoppix box takes in contrast to the little the Dlink uses. But if you insist on doing this, there have been other discussions in this forum on doing it. But use switches or even hubs in place of the two routers; as the routers will not let any traffic needed for the network pass out of the port that normally would have gone to the modem.

As to cross over cables, this makes perfect sense. The modem is wired so it can connect to a PC with a straight through cable. So a router wires it's port that would connect to the modem just like a PC NIC (it's other ports are wired to talk to a PC nic, unless there is a special port to talk to downstream devices, a switch on one of the ports for this purpose, or the ports are "auto sensing"). Since you're trying to circumvent the normal operation of the device and connecting two PC ports together, you naturally need a cross over cable. But that's the least of your problems.

ghostblaze
10-31-2004, 09:33 PM
...well, thanks for the advice harry :)

...definately much appreciated, as in, you probably saved me alot of time by not having to configure the IP table...

but yeah you're right about the fact that I would only be able to share files on one or two of the machines behind the routers... I remember that when I tried with win, I could only ping the routers...

I'll see what I can do with the topology....

I'd say use the dlink just for it's 4 ports (not using the uplink at all) and use the knoppix box as a bridge between the two routers, have another box connected to the knopper and have 3 pcs connected to the remaining 3 ports on each router, that way I think I can get them all connected... there's tons of ways I could fool around with this.... what are your thoughts?

switches look to be pretty inexpensive so I might pick one up....and save me some of the hassle...

ps. so by not using the uplink on the dlink that would then make it a switch?

...and not a hub?

if so, thanks for the schooling there... looks like I'll need ALOT more of that.... :/

Harry Kuhman
10-31-2004, 11:58 PM
but yeah you're right about the fact that I would only be able to share files on one or two of the machines behind the routers... I remember that when I tried with win, I could only ping the routers...

Sure, because NAT is taking over and it doesn't pass the ping (who would it even past to?) Also, as a learning experience you might want to run Ethereal some time and watch the various ARP and other traffic that goes on behind your back. Then think about how the NAT router works and how this traffic can't/wouldn't/shouldn't be routed to the "upstream" port. So the left network would never know what the right network is doing, and vise versa.

Remember, by definition, all 192.168 addresses are private use network addresses, and so routers are designed to not pass them. See RFC 3330 and RFC 1918. http://www.faqs.org/rfcs/rfc1918.html


I'd say use the dlink just for it's 4 ports (not using the uplink at all) and use the knoppix box as a bridge between the two routers, have another box connected to the knopper and have 3 pcs connected to the remaining 3 ports on each router, that way I think I can get them all connected... there's tons of ways I could fool around with this.... what are your thoughts? /
My thoughts are that you already have a DLS/Cable router (two apparently), I would use that as my interface to the cable box and the ISP. I'm a cheap son of a bitch, and I have a lot of old spare computers laying around (It really broke my heart when I finally had to admit that my old 386 that I paid over $3000 for and nearly that much more in upgrades just wasn't worth even trying to use for anything, but I finally did), Still, with a lot of spare systems available, it still made sense for me to get a Linksys router back when I first got DSL, and at the time it cost over $100 (and that was U.S. dollars, not that Canadian play money, eh?). Now these devices have gotten dirt cheap; I've even heard tales of routers and even wireless routers free after rebate (never seen a free one though). So you might as well use one if you already have it. Plug it into the cable modem. Plug the Knoppix boxes and your other boxes into that. If you really must add other systems through multiple NICs in the Knoppix box, it would be much simpler to let Knoppix just act as a switch rather than have it do all of the DHCP, NAT, and other stuff that a router like the Dlink does so well.

And you don't gain anything by putting the Knoppix box first; your total number of connections does not increase. In fact, you pretty much shoot yourself in the foot by keep trying to put the Knoppix box first. You'll never get the Dlink to do what it was intended to do that way.

switches look to be pretty inexpensive so I might pick one up....and save me some of the hassle...
Absolutely. I've seen several advertised as low as $9.99 US. And I wouldn't be shocked to find some cheaper. Or to find a used switch or hub with a lot of ports (24 or more) dirt cheap. Make sure you know the difference between a switch and a hub. And while for almost all uses switches are better, there is one thing that you can do with a hub that you can't do with a switch: Siff the traffic on a network cable by inserting the hub and watching all the traffic with an additional computer. So if you ever need to watch traffic to figure out a particularly nasty problem (like why DHCP handshaking stopped working for Linux after you installed a "security update" of software from an evil monopoly), you'll want a hub.

ps. so by not using the uplink on the dlink that would then make it a switch?

...and not a hub?

Almost, but not quite. At a minimum you also need to make sure that the DHCP features of the second router were disabled. You don't want it handing out NAT IP addresses, you want only one router on your system doing that. I would also move it's IP address to some out of the way IP address on the same subnet the other router uses. For example, if the dlink is 192.168.0.1 and you are using it as the router to connect to the modem, then if you can disable DHCP on the Ovislink router, see if you can not also change it's IP address (every router I've seen lets you do this) and move it from 192.168.1.1 to something out of the way like 192.168.0.253 so that is is on the same subnet. Then make sure that the Dlink never hands out that address (set it's assignable IP range to something like 192.168.0.100 to 192.168.0.199). That way everything lives happy on the same subnet. Then you should be able to plug the Ovislink happily into the Dlink (without going through the KNoppix box at all). You would just plug one of the 4 ports into an available port on the Dlink (and, if you think about it, you'll see why that will need either a cross over cable or a crossed over port, a port with a slide switch to do the crossing, or an auto-sensing port)

Diaclaimer: Your results may vary. The proof is left to the student. This is all just theory.

And yes, the thing in the router, at least in the Dlink, is a switch, not a hub. It can run at 10 mbs or 100 mbs. It can run different ports at different speeds. And it watches the traffic and knows what devices are on each port, so it knows to only route traffic to the port where it needs to go. That's why you can't sniff a wire with a switch; you would only see the traffic intended for you, not all of the traffic on the wire. A hub just replicates all traffic on all ports, so you can see what is happeing on the wire.