Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I really am not sure how they are configured (static or dynamic). When I open /etc/resolv.conf using vim , this is what I get:
; generated by /sbin/dhclient-script
search Belkin
nameserver 192.168.2.1
At this point Simple sounds pretty good! Evidently this whole network thing is a little beyond what my abilities are!
The only experience I have with /etc/hosts is when I changed the hostname and domainname from "localhost.localdomain" to "Goliath.justbillsguitars.com" on box1, and "Ulysses.justbillsguitars.com" on box2. I am using the "Gnome" desktop on both machines, and when I changed names "Gnome" had a hissy fit :-) , and wanted it changed in /etc/hosts.
OK, I may have gotten somewhere with this! when I typed /sbin/ifconfig eth0 on each computer the inet address on each computer had a different last number. The Bcast, and the Mask were the same. I did ping the number I got from box2 on box1 successfully, and also the other way around.
I never did see a line with a UG in it , and, unfortunatly I no longer have the manual for the router. I did successfully ping 192.168.2.1 which is a different number (the last digit) than the inet address that /sbin/ifconfig eth0 gave me for each computer, so I guess we can assume this is the router.
Distribution: Anything NOT SystemD (ie. M$) related.
Posts: 918
Rep:
Where do you want to go.. OH, never mind, that saying has been patented
It sounds like you are making real progress.
Originally you just wanted to file share among lin, and printing.
File sharing can be done several ways, depening on your needs and tastes.
ssh is good for quick and dirty command line copying (but be careful, it does NOT warn when overwriting!!).
AND it does not do RECURSIVE copying (ie. digging into directories).
For that you could use scp (cp command, using ssh), and the -r switch (for recursive). There are other ways like netcat & resync, but I'v never got to the point of being able to learn them.
Remember man is your best friend
Ftp (i found) is a pain with such a small setup, but maybe someone has new light on this subject to share.
Printer sharing I'll leave to the others guys (with samba experience).. although i'd make sure that your printer is supported (and/or) working in your distro before tackling printing over your network.
Dont' be discuraged or upset.. learning the basic (concept) with even a simple network like this is NOT easy.
However, once you 'get it', you will have the ability to grasp the larger projects and all the other qool things that come with knowing nets
It seems like now I know what my IP addresseses are,so, now that I have that, and I have used the NFS server configuration tool, I have added a share, put the IP address of the computer I want to let have access to that file in the host box, how do I access this file, or this computer (box1) from box2?
Congratulations. You now have a network. NFS under commercial Unix provides a virtual drive. I am not sure if this is true with Linux. I have not set up NFS on my Linux servers. BTW: Which Linux distribution are you running?
I have read quite a bit of help files , and documentation on NFS, and it seams simple enough to add a share, and set the permissions. I have not been able to figure out how to access the added share from the other computer. I can find information for NFS as a server, but how does the client access? So far I have attempted to add a share on box1, I can't figure out how to access it from box2. Can anyone help with this, or is there another way to do what I am wanting to do (print/fileshare) from box1 to box2. Both boxes are Linux distrobutions, box1 is Fedora Core 4, box2 is CentOS 4.2
to use a nfs share you need to mount it
typically mount ipaddyath_from path_to does the trick. (I'm assuming that you've done a default install on both boxes so the services/daemons are running
eg
mount 192.168.2.3:/home/games /home/otherbox/games
You may want to put something like that in /etc/fstab (the file that it uses to mount stuff at boot time. If you did then it would look likt he following
to "share" the directories edit
/etc/exports
a typical line would look like
/home/games 192.168.2.0/255.255.255.0(rw,insecure,root_squash)
that's read/write, assume it's insecure and don't let root do stuff with it
192.168.2.0/255.255.255.0 (network address/netmask) says anyone behind your router can access that share.
Well, Iv'e been trying to not bother anyone with more of my questions,but...............
I have been trying to file share with no luck at all, for the last week. I have been using the above instructions (which seem to be getting me closer to success than anything), but at this point when I try access from box2, I get a message " could not mount NFS share ipa.ddr.e.ss server is down". I have tried different variations, and have tried using the gui to accomplish this but still NO LUCK!
Can anyone tell me, did I miss something, if it says the server is down (and the computer I was trying to access was on, and logged into my page when I tried this from box2), was I supposed to configure box1 as a server? If so, how do I do this?
Thanks
a very confused
Justbill
how depressing: a little plastic box, that is supposed to do what I tell it via the keyboard, is not only not cooperating, but I think its mocking me!
Distribution: Anything NOT SystemD (ie. M$) related.
Posts: 918
Rep:
i'm sorry i don't have alot of experience with nfs.
sun.com should have some good docs.. it's their baby.
the only thing i remember when i messed with nfs is that the the 'sever' needs to be up and running BEFORE you fire up your client (ie the machine you will be printing from).
now although might be ONE way to do things.. it is a start.
you should see in your logs (if the start up screen goes by tooo fast) that your sys 'found' the share and mounted it.
this is why it is important to understand and do what the other posters have said about mounting in fstab and possible mtab.
you may want to look into nx.. i think it uses nfs .. but not sure.. either way i think it will be more user friendly to get you started.
if it is any consulation, sharing printers is not one of linux's strong points (afaik).
I'm not sure but I think I might be making some progress with this. First, I had no luck at Sun's site. All I could find was documentation on current products. I tried adding box2's IP address to the /etc/hosts.allow file, but everytime I tried to mount box1 from box2 I got "must specify file system type" message. Hmmmm got me puzzled! So, does anybody have any ideas what I might try next. My brain is about to melt down trying to outthink this silly machine :-).
I'm kind of wondering............. It ust occured to me, on box1 I'm using FC4 on ext.3 file system, on box2 I'm using CentOS 4.2 on ext.2 file system. Could it be being quirky because I'm trying to communicate ext2 to ext3 ? I dunno.
Ok, let's do this step by step. If you haven't gotten tcp/ip working right, her goes. Your router probably has the ip address 192.168.2.1 (or so i gather from the previous posts).
1. Ping 192.168.2.1 from either machine, you should be getting a response.
2. If (1) didn't work, maybe the router isn't at 192.168.2.1. As michaelk suggested, run /sbin/route and look for the line that says "default" and look under the gateway collumn - this would be your router ip address. Try pinging that address, it should work.
3. Now, you need to find out the ip addresses of you two computers. /sbin/ifconfig will show this. Next, try pinging each machine's ip from the other. Example: if comp1 is at 192.168.2.3 and comp2 is at 192.168.2.4, then
from comp1 if you ping 192.168.2.4 you should get a response, and vice versa. Don't worry about pinging hostnames for now, just use the ip addresses.
4. If your two computers successfully pinged each other then they're "seeing" each other. At this point you may want to statically set both computers' ip addresses. There's nothing wrong with this, except make sure to set the "default gateway" to your router's ip address. And for DNS, if you know your isp's dns server addresses, type them in for primary and secondary. If you don't know your isp's dns server addresses, try just filling in your router's ip address as the primary dns server, and leave the secondary blank. If you correctly set the gateway and dns addresses, you should be able to access the internet, with static ip addressing. Static addressing would be easier for the file/print sharing later.
5. Now, that the network is fine, it's time for the file,print sharing. If you want to use NFS try disabling the firewalls on both machines first. NFS uses randomly allocated ports that iptables doesn't like. I'd suggest you use samba, as the configuration for both file and printer sharing is in one place, and it's compatible with windows as well. If you're not afraid of the command line you could have a go at editing the samba configuration file (smb.conf) manually, that way you'll have a better idea of how it works. Otherwise your distro might have provided a gui to do this. Some things to keep in mind:
- when you edit the samba server configuration, you'll need to put in a samba hostname. This is in no way related to the unix hostname, and you shouldn't need to touch the unix hostname configs.
- for the initial configuration, turn off the firewall (iptables) on both machines. Later on we can turn it back on and open the neccessary ports. If you're behind a router you're relatively safe anyway.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.