Im trying to make a Linux and Windows 98 network...
The "server" so to speak would be the Linux one, which is the one with the modem (dial-up modem that is), but this is my workstation so i plan to use it while i share internet with a win98 pentium 133mhz box.
Ive been looking some Samba docs, but i dont think is useful for what i need, i want to access to the win98 pc and to share internet with it... does Samba allow me to do that?
Does anyone know of any guide or 'how-to' to share a dial-up line via a ethernet --coaxial or rj45, 10mb--?
Thanks in advance!
Damn, i did look in google, but i was including the words: ethernet and dial-up... and forgot to use the modem one :?
Anyway, i found a couple i already read, a lot of useless ones and 2 that actually may be the ones i needed...
Thanks and sorry.
Nat should be your theme.
Make linux dial when it has to, and tell windows it's gateway was the linux machine. Set up nat on linux, that's it.
Frumpus ♥ addict
Yes NAT is (more or less) the best idea. Something like this in your rc.local (install iptables package if you don't have it already)
/usr/sbin/iptables -F -t nat /usr/sbin/iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
and it should do nating for the local network. I suppose you have to change eth0 to ppp0 or something (use the name of the device which is connected to the internet). You will then need additional network card to connect linux box to windows box. I have a similar config for a machine running knoppix and acting as a nat for a small local network (but I'm not using dialup - only ethernet). The configuration for the second network device should look like this:
eth0="eth0 192.168.0.1 netmask 255.255.255.0"
(check if the network card will be avaialable as eth0 or something else) 192.168.0.1 will act as a gateway for your windows machine then. I don't remember if you need to add any modules to rc.conf or if they will be loaded automatically - you have to experiment :-) Also don't forget to use a crossed network cable if you want to directly connect linux box network card to windows box network card or you can use normal cables if you have a switch or hub.
You can also find some wiki items about setting up samba to access windows shares - I've never done it myslef so I can't help you much with this but there should be some simplier tool for just accessing windows shares - ask on IRC maybe.
Hi, thanks for the extra hand...
I found a good guide which told me more or less the same thing you did, i got to ping the windows machine and from that one to this one, but i cant get the windows one to be able to browse...
I think im doing everything as i read, here is what ive been doing:
]# modprobe iptables_nat ]# iptables -t nat -A POSTROUTING -s 192.168.0.1/24 -o ppp0 -j MASQUERADE ]# echo 1 > /proc/sys/net/ipv4/ip_forward
My eth0 stuff:
eth0 Link encap:Ethernet HWaddr 00:00:21:68:4F:51 inet addr:192.168.1.0 Bcast:192.168.1.255 Mask:255.255.255.0
My ppp0 Stuff:
ppp0 Link encap:Point-to-Point Protocol inet addr:126.96.36.199 P-t-P:188.8.131.52 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
(Both of this have a couple of lines i left out coz i dont think they are usefull)
As i sayd, i can ping the pcs between them, so they are 'networked'... i think im doing something wrong with the forwarding...
The client PC (windows), i set the IP of my host as its gateway and didnt touch any application configuration, nor any other things related... do i have to change something else?
Also, i cant restart iptables service, it asks for a iptables.rules, i gave a look at the simple_firewall file but i dont quite get it yet... if it isnt much to ask, can you post your rules file?
Thanks in advance!
I'm not using iptables as firewall at all so no rules file :-) I'm using it just for nating. BTW you don't need to restart iptables just clear the rules. This command clears the nating rules:
/usr/sbin/iptables -F -t nat
Then you load new nating rules with your command. I think the problem is with the wrong source address: 192.168.0.1/24 and you are setting up your eth0 as inet addr:192.168.1.0 so it can't do nating, I think. Try to change it to
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o ppp0 -j MASQUERADE
or remove the s option at all (that's what I'm doing and it works). Your windows client should then have ip adress 192.168.1.2 and netmask 255.255.255.0 - this should work or try without the s option (remember to always use /usr/sbin/iptables -F -t nat for clearing). I think windows doesn't need anything else. You could also use 192.168.1.1 as ip address for your eth0 but that's just a cosmetic change (netmask still will be 255.255.255.0 which means you can set up additional 255 ip addresses). Does it work now ?
I see.. i didnt know that i had to clear the rules before changing the routing address and the other stuff.. about the different IPs, its actually a copy and paste mistake, i was trying to make the ping work with 192.168.1.0 but didnt work, so i switched to 192.168.0.1 for the host and .2 for the windows PC, this time i got the ping working but no internet access... guess i copied the wrong ifconfig (had 4 consoles open ) or actually didnt restarted the network before posting (and this means im an idiot and all the problem was what you sayd, the address for the gateway would be wrong)
I will check everything you sayd as soon as i can!
Thanks a lot.
How about collecting that stuff and post it @ wiki? If rc.conf is concerned, it is definitely a special arch way, as no other distro uses rc.conf, afaik.
Frumpus ♥ addict
I plan to make a wiki after al the headaches its giving me, dont worry!
I cant get it to work.. also i discovered that if i boot while loading the modules ne2k-pci and network daemon, i cant use the modem, for some reason it says its busy.. i think it has something to do with IRQs...
Anyway, when i start the network and load the nic module while the pc is already running, i can ping the win pc, and the win pc can ping the linux pc, but i cant get it to access the internet...
I dont understand whats going on... i have tripple checked everything you named ....
Are you sure that ppp connection from linux box is running while you try to access the internet from windows box ? (just checking :-))
Do you have any other rules in your firewall ?
If you load the module manually after starting the network is eth0 properly configured ? (ifconfig -a should show all interfaces).
Did you try to remove -s option?
In windows box you also set gateway ip the ip of your eth0 card, right ?
Could you post the network config fragment from your rc.conf ?
BTW can you access the internet from linux box normally ? Did you try to ping some ip addres on the internet instead of something.com from your windows box (did you configure any dns servers in windows ?).
Do you have these errors which show up when starting ne2k-pci from rc.conf? (dmesg? /var/log/errors, /var/log/kernel, /var/log/messages?). Do you still have echo 1 > /proc/sys/net/ipv4/ip_forward somewhere?
I've just reviewed some other descriptions of setting up nating in linux but they are all the same - nothing else that you are already doing. This must be something simple
Run one of the following scripts on the Linux gateway computer:
iptables --flush - Flush all the rules in filter and nat tables
iptables --table nat --flush
iptables --delete-chain - Delete all chains that are not in default filter and nat table
iptables --table nat --delete-chain
# Set up IP FORWARDing and Masquerading
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT - Assuming one NIC to local LAN
echo 1 > /proc/sys/net/ipv4/ip_forward - Enables packet forwarding by kernel
Try adding this "iptables --table FORWARD....." thing. Also check if all the iptables/nat modules are loaded correctly (lsmod).