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 have been doing a TREMENDOUS amount of reading on this subject the last couple of weeks, and have really gotten nowhere!
I have 2 computers sharing an internet connection on a Belkin F5D5231-4 router. This is a hard wired network. When I first connected the computers to the router, they were both able to connect to the internet with no problem. I then tried to print something, and found that I had change my printer settings on box 1, that has the locally connected printer. I had to change to a "shared" printer. This led to believe that the 2 machines were "seeing" each other. To try to make this long story painfully short, I have changed the "Hostname" and "Domainname" on each computer, I have tried to set the IP addresses (in Network Configuration ), but when I change them, I lose my internet connection. The primary DNS is 192.168.2.1 . There is no secondary. I tried to ping each computer using the hostname, but that came back "unknown Host". Am I asking to much of my router here? I'm hoping there is a way to do this. Here are my specs:
Box1
dual booting Win. XP & Fedora Core 4
Compaq Presario SR1426NX
2.93GHz Pentium 4
512MB PC2-3200 DDR2 SDRAM
160GB 7200RPM Serial ATA hard drive
Box2
dual booting Win. 98 & Centos 4.2
HP Pavilion
500MHz Celeron
256MB RAM
80GB hard drive
My router, as I said earlier, is a , Belkin F5D5231-4 router.
I think I am almost there with this, I just seem to missing something here, and I believe what I am not entirely understanding is the whole IP address thing. I've been trying to get things started with this
tutorial, but I think the problem is that I have a router, and he is using a crossover cable. I just don't know!
Any Help would be greatly appreciated
You may want to start at the beginning. You know, "I am building a home network with the purpose of creating a ......... I need to run a DNS in this private space even though I have only 2 host systems because ........."
I am very curious why you are running a DNS. Are you hosting something like a web server that Internet clients can connect to?
O.K. So maybe I'm on the wrong track here. All I want to do is file share between the two machines, and be able to use the printer, that is locally connected to box1 (usb), from box2. I guess I've mis-understood what I've been reading, I thought I had to do it through DNS. I guess my first mistake here was the "I thought" :-)
DNS has almost nothing to do with file/print sharing. To share files between Windows & Linux boxes you'll look up a program called Samba. Samba will also allow you to share the printer.
By the sound of it the router is at 192.168.2.1 ( it's the default gateway if you use dhcp).
If you can set the ip addresses to be static, that will be easier for you. That could either be using the mac address to set a static address on the router, or manually assigning the address (but then you'll need to do gateway, dns server etc.
There are 2 different ways of sharing the printer. CIFS/SMB with Samba & Windows or unix / linux with lpr (or similar).
If the one with the printer mainly runs windows then you're probably best with samba.
When it's running windows you'll need to share it under samba. Then the 2nd computer will print using samba no matter if the first is windows or linux.
If the pc with the printer has a static ip, then it will be easier
he has a belkin router... There is nothing wrong with disabling the DHCP option on that belkin and assigning static addresses to all of the host computers (on the nics he connects to the router), there will still be internet.
I think I need to clear something up here! We have Windows on both these machines, but never really boot Windows. We use our linux OS's, almost exclusively! I would like to have the 2 machines be able to fileshare, and be able to print from box2, to the printer locally connected (HP 1315psc usb) on box1. I tried using NFS, and so far have been unsuccesful. I have tried to ping box2 from box1 and visa versa, with no success! So, if some one can point me in the right direction here, weather it be a tutorial, or different hardware, or whatever, it would be greatly appreciated. Currently (and this may be the problem, I just don't know) I have 1 ethernet card in each computer, both connecting to the router, is this where I begin? But I am not trying to communicate Linux to Windows, I am trying to communicate Linux to Linux (FC4 to CentOS 4.2)
Thanks
Justbill
afterthought: My internet connection is broadband (cable)
I use a four port printer switch, cost me $12 at tiger direct. It's usb and I just press a button for which ever computer I want to print from. This works because my computers are not that far from each other and we don't really do a whole lot of printing. Of course this may not be ideal if you have one computer upstairs and there is nobody to push the button for you :lol:
Note to halvy and bdogg, I said nothing about disabling DHCP, that's still very useful when additional pc's are connected (if ever, eg someone visiting with a laptop). This issue was either restricting the DHCP pool to less than the entire /24 OR entering the MAC addresses so the router assignes them the same address every time.
But to the point at hand As ruuster states, there are some VERY BASIC network issues here.
Are the all the computers plugged in, switched on and have network cables connecting them.
Do the nics / ports on the router have link lights?
OK, I'm going to do the best I can here. I am no guru by any means, so go easy on me guys!
First off, both computers are directly connected to the Belkin (4port) router. The lights on the router are on , on port 1 & 2. The lights are on, on the ethernet cards, in each computer. There is no hub or switch, they plug directly into the router. Box1 is on port 1, and Box2 is on port 2. So far I have only been able to ping 127.0.0.1 , from either computer. I am not sure how I would ping the router, except to type in "ping Belkin", or "ping router", which I have tried, and the response was "unknown host". I also tried to ping each computer using the host&domain name, and got the same response, "unknown host". I typed in ifconfig -a , and got "command not found". I thought the 192.168.2.1 was the address, so I guess the answer would be no, to the do you know the IP address of each computer. How would I find them out? Both computers have successfully been accessing the internet with no problem. So, if this is a very basic networking issue, I guess what I need to do is start from scratch here and simply ask, what do I do?
How are the computers presently configured, static or dynamic IP address?
Can you ping the router by IP address?
Can you ping the other computer using its IP address?
If configured using a static IP address then the /etc/resolv.conf file is not being updated from the router. This DNS nameserver data from the router is just for the internet and not your local network. Which is the reason you can not ping your computers by their hostname.
With 2 computers the simplest and quickest solution would be to use static IP addresses and add an entry to the /etc/hosts file with the IP address and hostname of each computer. The will resolve IP address to hostname without using DNS. You will also need to update the /etc/resolv.conf file to add the nameserver info from the router.
It appears that your PCs are configured for dynamic IP address.
To find out the IP address of your PC type in a console window:
/sbin/ifconfig eth0
The router's manual should show its default IP address. But I would guess it to be
xxx.xxx.xxx.1 from the results of the output of ifconfig command. xxx being the same as your IP address.
According to the documentation I have found the default IP address is
192.168.2.1.
Also posting the results of the console command route will indicate the default gateway for the PC. Look for the line that has a UG. This will be the IP address of the router.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.