PDA

View Full Version : How can I sharing internet in Knoppix 5.0 with GUI/textmode?



cishpix
10-17-2006, 09:06 AM
Everybody can help me to sharing internet in Knoppix 5.0?? I use a computer that has 2 LAN card. LAN 1 (the IP 192.168.1.2) is connect to Internet (ADSL) use (the IP 192.168.1.1) and LAN 2 (the IP 192.168.0.3) is connect to network. My client computer is use Win XP that use DHCP. How can I sharing that?

Harry Kuhman
10-17-2006, 03:49 PM
With those addresses it looks like you already have a router, perhaps included in the modem. I would strongly suggest that, if you don't have multiple etherne ports on the modem and don't have a seperate router) you add a hub or a network switch (mutlti-port hub like device, no physical toggling of switches involved) between the computer and the modem and plug your other computers into that. While Linux can act as a router and pass along the connection, there is overhead and issues why you wouldn't want to do that and a switch or hub should be very inexpensive and is intended to do just this.

cishpix
11-03-2006, 10:20 AM
I already have a hub that has 8 port. Actually I don't understand your answer because I'm newbie in Linux. From eth1 is connect to Hub and there are 6 client connect the hub. So I can't sharing the Internet connection to the client computer from ADSL internet connection through Knoppix.

Harry Kuhman
11-03-2006, 08:49 PM
I already have a hub that has 8 port. Actually I don't understand your answer because I'm newbie in Linux. From eth1 is connect to Hub and there are 6 client connect the hub. So I can't sharing the Internet connection to the client computer from ADSL internet connection through Knoppix.
I don't think this has much to do with being a Linux newbie, it's basic networking, should be understandable by someone who only runs Windows, but runs on multiple systems. Glad to hear that you already have a hub, but you still haven't picked up on the thought that it would be helpful to tell us about your complete network (for example, we still don't know what DSL modem you have and can only guess from the IP addresses that you show that it has a router built in).

Assuming the modem includes a router then the setup should be very clear, the phone line comes into the dsl modem/router. That has an ethernet connector on it that goes to the hub. Other ports on the hub fan out to all of your computers. All computers can use the Internet connection at once, thanks to the router. No computer passes the connection through it to another computer, no "sharing" is done through Knoppix. I'm hard pressed to understand what the actual problem is. I expect something isn't working as expected but you don't give the information to tell what that is or even to understand what is not happening that you think should.

cishpix
11-04-2006, 06:26 AM
To make you understand about my problem (Sharing Internet connection from Knoppix to other computer), you can see in the below

|
|
| phone line
|
|
--------------------------------------
| ADSL Router/Modem |
| 4 Port Swtich |
--------------------------------------
| 192.168.1.1
|
|
|
| 192.168.1.2
--------------------------------------
| Computer with Knoppix 5.0.1 |
--------------------------------------
|
|
| 192.168.0.1
|
|
--------------------------------------
| Hub with 8 port |
--------------------------------------
|
|
| to Client Computer
|
|
--------------------------------------
| 6 Client Computer use Win XP |
| that use DHCP |
--------------------------------------


Ok, I think it can make you understand. I’ll do it because I want to block the adult web so that the client cannot go it because the people that use the client computer is my student. If I use Win XP to sharing the Internet Connection is so very easy but cannot block the adult web. So I'll use Knoppix to sharing it and just use IPTABLE can block it.

Sorry, if my English isn't good and sorry too if my problem is so difficult.

Harry Kuhman
11-04-2006, 07:01 AM
Well, we are making some progress, I finally understand what you want to do. You basically want to use Linux as a second router and add some rules for blocking addresses (and perhaps for blocking some services). I assume that you realize that you would need two eithernet interfaces in the Linux box to do this. As to doing it in Knoppix, I don't know of any software included on the Knoppix CD to let you do this. That's not to say that it's not there, might even be on the DVD, but doing it with Knoppix seems to me to be doing it the hard way. There are plenty of Linux distros that focus on being routers, it would strike me as more desirable to use one of those as a starting point. I'll make a couple of suggestions below.

Understand, of course, that there are some issues in doing this. Since you already seem to have a NAT router in that upstream modem, if that router can't be disabled then you'll be setting up a "double NAT" situation. While you be able to apply access rules and restrict access to some sites, the double NAT may cause you other problems with some applications, including web based games, VOIP applications like Skype and particularly Net Meeting (which didn't do all that well even with single NAT) IM applications, and other application, particularly applications that require inbound traffic from unexpected IP addresses to the application.

My first site to go to would have been www.linuxrouter.org, but it doesn't seem to be in operation at this time. You might want to try the Live CD router here (http://distrowatch.com/table.php?distribution=livecdrouter). There is also a Linux router here (http://leaf.sourceforge.net/). I know there is even a router that is available as a bootable floppy, but I'm having trouble locating it. Perhaps now that we know what your attention is someone else who knows more about Linux routers can suggest something that can be used under Knoppix, but I hope I've given you some things to look at while you wait for that to happen. Beyond that Google should allow you to find plenty of info.

cishpix
11-11-2006, 03:28 AM
I can solve my problem with your idea so I thanks for you, but I still have a problem. Can you help me? Before I write my the solution, the first I must have a linux such as floppyfw or livecd router from the Internet. I use floppyfw 3.0 or livecd router 2.0.10.

The solution is:
1. # ifconfig eth0 192.168.1.2 netmask 255.255.255.0
2. # ifconfig eth1 192.168.0.1 netmask 255.255.255.0
3. # echo "1" > /proc/sys/net/ipv4/ip_forward
4. # vi /etc/resolv.conf (write your ip nameserver)
5. # route add default gw 192.168.1.1
6. # route add 192.168.1.0 gw 192.168.1.1
7. # route add 192.168.0.0 gw 192.168.0.1
8. # iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -d! 10.10.0.0/16 -j MASQUERADE (I don't understand about this line, can you explain it?)

Maybe someone can do it if you have a problem like me, but I still can't do my solution in Knoppix or RedHat and I must give IP address (manual) for the client computer (anyone can help me??)