Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Two Computers, Samba, CUPS, Sharing, No router... ach!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Normie
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2002
Posts: 83

PostPosted: Mon Jan 13, 2003 2:34 am    Post subject: Two Computers, Samba, CUPS, Sharing, No router... ach! Reply with quote

Here's the story.

I've got a gentoo computer with a printer set up and working fine through the parallel port and CUPS. Besides the printer, I have a couple of directories I want to share with another (WinXP) computer in the house. Both computers are in the same subnet (68.104.xxx.xxx), but here's the problem:

Neither computer is behind a router.

Now, this shouldn't be a problem, but it is, since both computers are open to the rest of the computers on my ISP. More importantly, no matter what I try, nothing decides to show itself on the Windows machine. Any advice?

-Normie

PS. I don't care about the linux box seeing anything on the windows box, just the other way 'round. (Printer included).
_________________
Achaea. Play it. Love it. Live it.
Back to top
View user's profile Send private message
cyfred
Retired Dev
Retired Dev


Joined: 23 Aug 2002
Posts: 596

PostPosted: Mon Jan 13, 2003 7:46 am    Post subject: Reply with quote

You should setup a firewall on your Gentoo box and use it as a LAN gateway for the WinXP box. That way you will be secure in your file sharing aswell.

You will need to emerge samba and configure it to access the Linux folders from windows (this is also needed for the printer). The following is my LAN gateway's smb.conf

Code:

[global]

   workgroup = OURGROUP
   netbios name = SERVER
   server string = Samba Server %v

   log file = /var/log/samba/log.%m
   max log size = 50
   log level = 3

   hosts allow = 192.168.1. 127.
   security = user
   encrypt passwords = yes
   smb passwd file = /etc/samba/private/smbpasswd
   username map = /etc/samba/smbusers

   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
   interfaces = 192.168.1.10
   remote announce = 192.168.1.255
   os level = 65

   wins support = yes
   client code page = 437
   character set = ISO8859-1


#== Share Definitions ==
[homes]
   comment = Home Directories
   browseable = yes
   writable = yes

[music]
   path = /home/music/
   public = yes
   writable = yes
   printable = no

[public]
   path = /home/public/
   public = yes
   writeable = yes
   printable = no

#END


Now you will need to modify that slightly for your needs, and since you only have one client IP that you wish to allow connections to instead of specifying

Code:

hosts allow = 192.168.1. 127.


Make it

Code:

hosts allow = 69.104.xxx.xxx


Make sure you replace xxx.xxx with the correct values.
Back to top
View user's profile Send private message
Normie
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2002
Posts: 83

PostPosted: Mon Jan 13, 2003 1:58 pm    Post subject: Reply with quote

You're going to have to explain the concept of a gateway to me, because I frankly don't get it. :oops:

I DO, however, understand the rest just fine--I'll give it a shot tonight, but the bit about the LAN gateway needs some 'splaining. ;)

-Normie
_________________
Achaea. Play it. Love it. Live it.
Back to top
View user's profile Send private message
cyfred
Retired Dev
Retired Dev


Joined: 23 Aug 2002
Posts: 596

PostPosted: Mon Jan 13, 2003 2:26 pm    Post subject: Reply with quote

Well it really depends on how you have the two machines setup.

If the both individually have seperate connections to the internet and you need to have them both like that then dont worry about it.

BUT on the other hand if they are really just two machines in your office or home that you want to share internet connections over the two of then you can use one as a gateway (or internet packet masquerader) for the two machines, typically this will be the linux machine.

All you need do is compile a kernel with some NAT and iptables support and then write either a set of iptables rules or run a simple program such as gShield to set up a masquerading (or NATing) gateway.
Back to top
View user's profile Send private message
Normie
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2002
Posts: 83

PostPosted: Mon Jan 13, 2003 4:08 pm    Post subject: Reply with quote

Here's how the computers are set up:

. Cable Modem
. |
. |
. |
Hub (splitter, whatever)
. / \
. / \
. / \
. Gentoo XP

I'm paying for two dynamic IP addresses.

It used to be that they were on completely different subnets (68.104.* and 24.120.*), but now that they're both on 68.104.*, I figured it would work. Naturally, it didn't. ;-)

At one point, I figured I'd put two NICs in the Gentoo box and use it as a firewall for the other computer (and thus only need one IP addy), but I couldn't figure it out, so I buckled and started paying for a second IP. Plus, the cable modem and Gentoo box are in separate rooms, and I ain't about to pay to get a second cable line opened. :P

But anyway, back to the point: despite the fact that the two computers are on the same subnet now, I can't get the network to...well, network. Any other advice?

-Normie
_________________
Achaea. Play it. Love it. Live it.
Back to top
View user's profile Send private message
cyfred
Retired Dev
Retired Dev


Joined: 23 Aug 2002
Posts: 596

PostPosted: Mon Jan 13, 2003 11:09 pm    Post subject: Reply with quote

Ahhh I see how you have it set up now.

Well Im assuming you already have a NIC in both machines, if you wanted to do away with the lease for the second IP you will need to buy an extra (3rd) NIC and stick it in the Gentoo box, leave the current one in the Gentoo box going to your cable modem, and set the other one up with a private IP (such as 192.168.1.10) and use that card to network the WinXP machine.

To set up the printer on your current setup could be asking for trouble, because in esscence you are printing and sharing windows files across the internet, which in all terms is vastly insecure. Not too mention that you would be having the traffic go out through your cable modem and then back in through it.

The main problem you are having with getting the two machines too see each other on a network, is that they are looking for each other on their Internet Connection device -- usually this they will see the other machine as something across the internet.

Even if that is not the case, I think windows only likes playing networking for LAN type situations for C Class subnets 64.104.88.* for both machines
Back to top
View user's profile Send private message
Normie
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2002
Posts: 83

PostPosted: Tue Jan 14, 2003 2:45 am    Post subject: Reply with quote

Guess I should consider investing in a third NIC then. :P

As an aside, when I have the Gentoo box booted into WinXP (for games and DirectX programming, mostly), it works just fine, even though only the first 2 numbers are the same (in fact, it works even if the IP's are completely dissimilar, as they once were). Does this seem odd to anyone else?
_________________
Achaea. Play it. Love it. Live it.
Back to top
View user's profile Send private message
tecknojunky
Veteran
Veteran


Joined: 19 Oct 2002
Posts: 1937
Location: Montréal

PostPosted: Mon Feb 03, 2003 4:42 pm    Post subject: Reply with quote

Hi Normie,

I'm not sure I understand correctly your problem other that the two pc don't see each others. Normally, with the configuration you have, you would not need a gateway since your ISP has one. So having your own when you have two routable public IPs is kind of riding in your car being carried by a towing.

What I think you need to make sure of is of what protocols you are talking about. Both Linux and Windows use TCP/IP for internet access, but Windows also use SMB protocol. That's what gives other PCs in the "network neigbourghood" windows.

I suspect that on the TCP/IP level, both PC see each other just fine. Can you ping one machine from the other? If so, then they see each other on the TCP/IP level.

For SMB, you need to install samba on gentoo. Samba is a SMB daemon that talks the SMB protocol. If you don't have it, you'll never be able to see Gentoo in Network Neigbourhood.

I may be beside the point and it's possible i'm saying things you already know and have done. Like I said, i'm not sure I understand your problem.

What I would suggest, however, is to change your topology. cyfred's suggestion would be much more economical for you. If you use gentoo as a NAT router, you would not need to pay for two nic and you would even not need a hub:

(Internet) <-> [cable modem] <-> [Gentoo Nic1 | Gentoo Nic2] <-> [WinXP]

Further, you could put the hub between the Gentoo box and WinXP and you could connect as many PCs (like a laptop) as you have available ports on the hub:

(Internet) <-> [cable modem] <-> [Gentoo Nic1 | Gentoo Nic2] <-> [Hub] <=> [WinXP]

... and they could all see each others, share printers, ... This configuration would avoid to have to pay (uselessly) for a second IP and I find your ISP to be lame cheap not having proposed you that. Mine do and even sell hardware routers for that purpose.
_________________
(7 of 9) Installing star-trek/species-8.4.7.2::talax.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum