PDA

View Full Version : [Linux] Networking for no0bs



Myth
21-05-2005, 03:14 PM
Hi all, I need help!! I am running FC3 on this computer, which connects to the internet via dialup. I have an XP Pro laptop that connects (via crossover cable) to the net through this machine (partner likes to play POGO games while Im browsing). I need to:
a) configure my ethernet card (FC3 sees it as a VIA Technologies card which sounds similar to what Windows did, so I am picking the drivers are loaded ok)
b) I need step by step setup instructions on how to configure the network (think of it as the idiots guide to networking Linux to Windows :p). I also have Firestarter installed, and all updates have been downloaded (yes I got there in the end (50+ hours of downloading and goodness knows how many MB :D))

p.s. if anyone (other than the nice mods of course) mentions smb or Samba, I am picking they will suffer a horrible end consumed by nightmares of a Windows-only world :p

beama
21-05-2005, 03:55 PM
samba (Runs away now)
I have a simular setup except the the xp box is the gateway and the linux lappy connects through it (yes xp box is dailup also and the network is a cross over ) the linux lappy even iniates the dailout on the xp box if I open firefox on lappy and the xp box is hasnt already got a connection
I think all you need to do is to set the gateway IP on the xp machine reflect the ip of the of the linux machine. Ill check my settings tomorrow when I get home and if there is not other response ill post them. It should be a simple matter to swapp the settings so that my lappy becomes the gateway

Myth
22-05-2005, 09:34 AM
<get back onto page 1 :)>

beama
22-05-2005, 10:23 AM
First things first.

Is the connection both ways ie can the two pc s ping each other and get a reply. If so great, if not we'll have to work on that first.

I simply had to add the ip of the nix lappy as the gateway on the xp box to get the windoze to use the nix lappy as its gateway to the net.

As far as Firestarter is concerned, I'm sure the default setup should be fine but you may have to add the windoze box IP as trusted connection.

I think you said you are using FC3, Jen is a Fedora Core person lets hope she sees this thread.

I manily use Debain based distro which maybe slighty different in the way things are done

There are plenty of help forums dedicated to linux out there. The one I use when stumped is www.linuxforums.org (http://www.linuxforums.org)
another good one is computing.net (http://www.computing.net)

Jen
22-05-2005, 10:30 AM
There is an easy to follow guide on how to setup ICS with your Fedora box being the gateway here: HOWTO: Set up a Gateway for Internet Connection Sharing (http://fedoranews.org/ghenry/gateway/)

FedoraNEWS has heaps of excellent HOWTO article's that you might want to check out sometime. :)

Fedora News Articles by Volunteer Writers (http://fedoranews.org/articles/)

Contributing Articles from Fedora Community (http://fedoranews.org/contributors/)

hamstar
22-05-2005, 11:02 PM
weeeeeeeeeeeeeeeeeeeeeeeeee!

Myth
23-05-2005, 10:27 AM
ok, this is where I am up to...
Followed the page (that Jen posted) on setting up ICS. My eth0 now is activated on startup, although I still have to activate the modem manually.
I have been playing with smb.conf (found a howto smb) and I now have my network to the point where Linux gateway can see Windows machine, and access it using password.
Windows machine can see Linux machine, but cant access it. A password screen comes up with <nameofcomp/username> already in the top row, and no password in the bottom.
In the linux machine I have added the username (it won't accept the nameofcomp/username format), and have given the username a password (which when filled in on the Windows screen just brings up the username/password screen again). If I take the nameofcomp out and just try the username and password (as it is in linux users, the nameofuser/password screen comes up again with the nameofcomp/username format.
Any ideas?
Here is the smb.conf (I found one online as there were no lines in my one when I went to edit it, and copied it, so its probably way wrong):

; /etc/smb.conf
;
; Make sure and restart the server after making changes to this file, ex:
; /etc/rc.d/init.d/smb stop
; /etc/rc.d/init.d/smb start

[global]
; Uncomment this if you want a guest account
; guest account = nobody
log file = /var/log/samba-log.%m
lock directory = /var/lock/samba
share modes = yes
smb passwd file = /etc/smbpasswd
workgroup = STATNET

[homes]
comment = Home Directories
browseable = no
read only = no
create mode = 0750

[tmp]
comment = Temporary file space
path = /tmp
writable = yes
public = yes

[statnet]
comment = Statnet files
path = /home
writable = yes
public = yes

I want a folder in /home to be a shared network resource. Workgroup is called Statnet, comp name of this machine is supposed to be StatServer (how do I change it without losing localhost loopback (as I have been reading around on the net and some who change the name tend to lose loopback)?
I have also set it so that both users home directory is /home in users and groups.
Other user (from other computer) is listed as a user on this machine in users/groups.

Oh and ICS doesn't work, the other comp cant access the net through this machine

This is all I can think of at the moment, Im sure I will remember more after I post this :S

Myth
23-05-2005, 12:34 PM
With the above problem, does it matter if the linux partition is formatted as ext2 or ext3?

Also, for some reason Synaptic won't load this morning :(

Jen
23-05-2005, 06:10 PM
With the above problem, does it matter if the linux partition is formatted as ext2 or ext3?That doesn't matter at all.


Also, for some reason Synaptic won't load this morning :(You mean the program just seems to hang? It does that ocassionally. You just need to kill it and then restart it. Use the keys CTRL-ALT-ESC and your cursor will turn into a skull and crossbones cursor. Just click on the window you wish to kill and it will shut down.

Now, to your samba woes. I haven't used samba since FC1 as my network now consists of Linux-Linux only so I can't be too much help. One thing that did catch me out was the Linux Firewall. Turn off Firestarter while you are still doing the setup. I also got hooked up on the password box when trying to access Linux from Windows, and it was a easy fix ... if only I can remember how .... :rolleyes:

Not sure why your smb.conf appeared empty. I've put my default smb.conf up on ImageF1, so just right click here (http://sal.neoburn.net/imagef1/files/smb.conf.txt) and select "save link as". You will need to remove the extra .txt extension I added so that ImageF1 would accept it. The default smb.conf is well commented with examples, so it should help.

Myth
27-05-2005, 08:42 PM
Ok, I currently can see both comps from each other, and have one folder shared :)
Still working through the ICS issue, but that should be easy compared to networking (jus gotta learn iptables I think)

I just wanted to thank the guys that helped out with ideas, and especially Jen :D

Thanx again

Chilling_Silence
28-05-2005, 08:57 AM
Try something like:
/sbin/iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -o eth0 -j MASQUERADE

Either that, or have a look here:
http://www.linux.net.nz/lists/NZLUG/2003/11/0015.html

Myth
28-05-2005, 11:22 AM
OK, found a site last night after I posted here (before I read Chills post) which was supposed to help with setting up ICS (based around iptables). Unfortunately I lost the ability for the Win Laptop to see my server.
However this morn I decided to check some things, found dhcp server (also gateway to net) wasn't working, so found howto and now have the dhcp server working successfully.
Copy and pasted Chills line into terminal as root and managed to see Linux box (dhcp server, gateway) again from lappie. Still no Internet sharing though.
Any ideas, without iptables killing my network again.

BTW, this is a mission lol, but damn at the networking s**t I'm learning :D

Myth
29-05-2005, 10:32 AM
Umm, Houston... we have a problem

I am finding that if I try and use iptables/masquerading that StatServer (the linux gateway, dhcp server) disappears from the network. Its still accessible via ping, and it can ping the windows box, but it doesn't show in the Network Places in Win XP. The Windows XP machine still shows in the Computer under Networks icon in FC3.
Whats causing this?

Incidentally, I installed Firestarter, even before I had rebooted to install properly, the entire network disappeared, so I uninstalled it. I did however try to configure it in the hope the network would come back. The StatServer couldn't even be pinged.

Also, I found this script online which I think will suit my iptables needs (If I ever get my server to show up again); seems ok to me (with my limited thus far knowledge of IPtables)... what do you think (@anyone)

#!/bin/bash
IPTABLES='/sbin/iptables'
# Set interface values
EXTIF='ppp0'
INTIF1='eth1'
# enable ip forwarding in the kernel
/bin/echo 1 > /proc/sys/net/ipv4/ip_forward
# flush rules and delete chains
$IPTABLES -F
$IPTABLES -X
# enable masquerading to allow LAN internet access
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
# forward LAN traffic from $INTIF1 to Internet interface $EXTIF
$IPTABLES -A FORWARD -i $INTIF1 -o $EXTIF -m state --state NEW,ESTABLISHED -j ACCEPT
#echo -e " - Allowing access to the SSH server"
$IPTABLES -A INPUT --protocol tcp --dport 22 -j ACCEPT
#echo -e " - Allowing access to the HTTP server"
$IPTABLES -A INPUT --protocol tcp --dport 80 -j ACCEPT
# block out all other Internet access on $EXTIF
$IPTABLES -A INPUT -i $EXTIF -m state --state NEW,INVALID -j DROP
$IPTABLES -A FORWARD -i $EXTIF -m state --state NEW,INVALID -j DROP

As a sidenote to the above script... ppp0 is configured so that the ISP provides the DNS and DHCP info for that interface (usual for dialup)

Will I need to disable SELinux if I use IPtables?

As a further edit, under SELinux rules, eth0 and ppp0 (when activated) are trusted interfaces

Myth
29-05-2005, 10:54 AM
Umm, Houston... we have a problem

I am finding that if I try and use iptables/masquerading that StatServer (the linux gateway, dhcp server) disappears from the network. Its still accessible via ping, and it can ping the windows box, but it doesn't show in the Network Places in Win XP. The Windows XP machine still shows in the Computer under Networks icon in FC3.
Whats causing this?
Nevermind, just happened to look in Services and discovered smb wasn't running (although the 2 daemons were). Put the dot in the box and hullo, the Server showed up :D