LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Internet sharing between Debian and Windows 98 (SE) (https://www.linuxquestions.org/questions/linux-networking-3/internet-sharing-between-debian-and-windows-98-se-77120/)

GhostOfYoda 07-29-2003 07:31 PM

Internet sharing between Debian and Windows 98 (SE)
 
Whilst I have finally installed Linux on my machine, and I use it all the time for all the stuff I do, whenever my dad wishes to use the internet, I have to switch to windows ME, as it has NAT internet sharing technology.

My PC, is connected to the internet, and my dad's (running 98se) connects to the internet through mine. I have a broadband connection, that is on all the time.

How can I set it up so that my Debian computer "shares" its internet connection with my dad's Windows 98 one?

bla 07-30-2003 01:11 AM

Its easy.
You must have this command typed: (typed in to `boot-scripts'):
iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -j MASQUERADE

It will masquarade connections from 192.168.0.0/255.255.255.0; Then You must have second interface. If you got second ethernet card then configure it.
IF You have only one card then create an alias: ifconfig eth0:0 192.168.0.1 up;
Second card should have ip number: 192.168.0.1;
Then You should change one thing more: /etc/network/options -> change ip_forward to `yes'.

To add alias for ever: write to /etc/network/interfaces:
auto eth0:0
iface eth0:0 inet static
address 192.168.0.1
netmask 255.255.255.0

Everything should work. (If You do not want to restart type echo 1 > /proc/sys/net/ipv4/ip_forward it will set ip_forward to yes.).
bla

GhostOfYoda 07-30-2003 06:47 AM

Yes; I do have two network cards, and whilst "eth1" (the one that I use to connect to the internet with) was pretty self explanitory to set up, I'm not sure about "eth0", (the one connected to the hub of my LAN).

Also, does anyone know how I would set up my windows computer to use my linux one to get the internet?

Also, where is "boot-scripts"?

dARkHunTEr 07-30-2003 11:17 AM

I'd say: get a router. You can get one for around $50, they have a built in switch (intelligent hub) and a firewall. The best thing is: you dont need to set up all operating systems; the router just passes dhcp info and your internet connection works :D.

bla 07-30-2003 12:06 PM

DHCP can be done. `boot-scripts' are in /etc/rc*; I have my masquarade in /etc/rc.boot/rc.iptables which is linked: ln -s /etc/rc.boot/rc.iptables /etc/rc2.d/S99iptables

It is executed at start (first line of file: #!/bin/bash; and chmod u+x /etc/rc.boot/rc.iptables).; Your windows computer must have ip from 192.168.0.2 to 255; And gateway set to 192.168.0.1 this is all.; If You have two cards it may be useful to specify `input interface and output interface' see manual. (;
bla

GhostOfYoda 07-30-2003 01:07 PM

Hmmmm, when I type it into the Console, I get this:

Yoda:/etc# iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -j MASQUERADE
Note: /etc/modules.conf is more recent than /lib/modules/2.2.20/modules.dep
modprobe: Can't locate module ip_tables
iptables v1.2.8: can't initialize iptables table `nat': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

bla 07-30-2003 01:44 PM

Did You compile your kernel yourself? Type: depmod; then type modprobe ip_tables; if it won't help: compile needed modules to your kernel;
If You use 2.2 kernel use ipchains (i do not know command to type, it is similar and simple) or type apt-get install kernel-2.4.18<something> (i do not remember, check: apt-cache search kernel | grep 2.4.18) reboot and type then. Iprefer 2.4.x kernels; on servers and on workstations. Good Luck.

bla 07-30-2003 01:48 PM

Ah and more: ipchains is used under 2.2.x kernels; iptables under 2.4.x (but ipchains is possible); iptables is `statuf-inspection or something' and it is just better than ipchains... Do it your way.

GhostOfYoda 07-30-2003 04:01 PM

If I upgrade to 2.4, will there be stability problems?

dARkHunTEr 07-30-2003 04:02 PM

get 2.6 :)

bla 07-30-2003 04:24 PM

I'm on 2.4 for REALLY long time and i've got no problems; All my systems are on 2.4 because of f.ex. journaling and there are no problems; 2.6 and 2.5 do not use; They are testing... there might be stability issue(huh, am i clear?)...

bla

dARkHunTEr 07-30-2003 04:49 PM

2.6 has a great networking speed :D.

GhostOfYoda 08-01-2003 11:19 AM

Sorry to wake up this oldish thread, but I have made some progress, but I am dearly confused by this instruction.

Quote:

If you got second ethernet card then configure it.
I was wondering, how do I configure a card for my LAN? I take it I have to add something to /etc/network/interfaces but I am not completely sure.


All times are GMT -5. The time now is 06:56 AM.