LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-10-2007, 03:53 AM   #1
Haz2a
LQ Newbie
 
Registered: May 2006
Distribution: Ubuntu
Posts: 12

Rep: Reputation: 0
How connect easily to other LAN PCs via hostname?


I have a small network of 6 Ubuntu PCs, all using 6.06LTS and running SSH servers, except my own Edgy 6.10.
To manage files on the other PCs I currently have to open the DHCP server on my router, look for the MAC of the PC I want to connect to, and make a note of its current IP. Then I either use GNOME's Connect to Server and fill in all the required details and finally open the connection, or ssh from Gnome Terminal.

What is the simplest way to:-

EITHER get all the other hosts to show up automatically on my PC, perhaps in Nautilus, by hostname rather than IP, and allow easy connection just requiring the login password?

OR at least allow me to enter the hostname into Connect to Server, rather than having to look up the IP in the DHCP server first?

Ideally I would like the choice of opening the connection either in Nautilus or in Gnome Terminal.
 
Old 11-10-2007, 04:19 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,849

Rep: Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121
for a quick and simple solution, run dnsmasq on one of the systems, assuming there's a suitable machine, and that will be able to do exactly what you want in 5 lines of config.
 
Old 11-10-2007, 05:41 AM   #3
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 5,995

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
My solution for this was to use static IPs for all my PCs.
I then list all these in all the /etc/hosts files Eg

Code:
cat /etc/hosts
127.0.0.1 localhost
10.0.0.6  p3.home.net     p3
10.0.0.4  p4.home.net     p4
10.0.0.8  vaio.home.net   vaio
10.0.0.20 server.home.net server
10.0.0.21 red.home.net    red
10.0.0.30 blue.home.net   blue
So now I can just ssh p3 or vncviewer p4:1
Works for me, but dnsmasq looks like another (fun) solution
 
Old 11-10-2007, 05:58 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,849

Rep: Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121
certainly that's viable, but then that's a config change on ALL boxes, which kinda sucks if you have more than a few. that said it's often worth asking if you *really* do need DHCP at all...
 
Old 11-10-2007, 01:38 PM   #5
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 5,995

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
@ acid_kewpie: I agree.
@ Haz2a:
Quote:
... perhaps in Nautilus, by hostname rather than IP, and allow easy connection just requiring the login password?
KDE (yes, I know you are using gnome, and maybe it has similar functionality, otherwise maybe install KDE) has the fish:// protocol built into its browser/filemanager konqueror. This is amazing .

I can put fish://HostName/home/tg into my browser (in reality, I use bookmarks for this, even faster) and zap! I am there, and can drag files to and from the computer I am sitting at. I expect I could drag files between computers I am not sitting at, but haven't needed to test this yet.

I have ssh set up with dsa/rsa-encryption keys, so I do not even have to privide passwords for my accounts. Secure authentication is automatic.

So, the functionality is there, and it all works perfectly.
Just sort out your IP addressing, either like acid_kewpie said, or with static IPs, and you are set to go.
 
Old 11-12-2007, 03:33 PM   #6
Haz2a
LQ Newbie
 
Registered: May 2006
Distribution: Ubuntu
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for your replies.
I do generally find DHCP very convenient so prefer to keep it.

I assume I'm right in thinking that a local DNS would require an always-on machine?
If the DNS was off for a week or two, wouldn't all those local-address links and devices be unreachable?

With that in mind I remembered reading about Avahi-Zeroconf and decided to give that a go. Had a bit of bother sorting Firestarter rules out to allow the multicasting traffic, but it now seems to work well in GNOME, and meets all of my objectives.
 
Old 11-12-2007, 03:39 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,849

Rep: Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121
heh, i'm getting old it seems... need to pick up on avahi... seen it load in a number of fedora releases now, no clue what it's really doing...
 
Old 11-12-2007, 04:41 PM   #8
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 5,995

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
@ Haz2a
Quote:
I do generally find DHCP very convenient so prefer to keep it.
Then keep it
Quote:
I assume I'm right in thinking that a local DNS would require an always-on machine?
If you have set it up so DNS is served locally then, yes, the DNS server will need to be running, and reachable.
Quote:
If the DNS was off for a week or two, wouldn't all those local-address links and devices be unreachable?
Quite possibly. It will depend on how the different systems are set up, and how they use caches and how often they are rebooted. You may have to do some experiments to find out what works under which circumstances.

To sum up: It all depends on what level of reliability and connectivity you need. If it is your home network, and grandma says she cannot print, then maybe you had better turn on the print-server, if you are at home. If it is your, or worse, someone else's business, then you had better make sure that it all works, all the time, under all conditions. Including a sudden, catastrophic, power failure or theft of the hardware.

Linux is not windows. There are many ways of setting things up. With linux, they are all under your complete control, but you need to do your own research to decide which is the best model or way of doing things for your circumstances. Then just do it. If you realise it doesn't suit you, then re-do it better.

dhcp or static? It's up to you. They both have their advantages and disadvantages (otherwise there'd be only one way of doing things). You have to make a choice, and no, I cannot tell you which one will be "the best" for you. Your circumstances and needs are different from mine.

I like static IP's, but then I run a small network of 6 PC's, at last count. My workplace (maybe 1500 PC's) is running "locked down" windows (joke), and also uses static IP's, and that's their choice and presumably that works for them.

Zeroconf works for you? Then good. Go for it.

@ acid_kewpie:
Quote:
heh, i'm getting old it seems.
You have no idea how old I am. I am ancient
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to switch easily between net connections on a box w/ PCImodem AND LAN connection? GrapefruiTgirl Linux - Networking 15 04-20-2007 01:28 PM
ssh does not work between two PCs of the LAN binary_dreamer Ubuntu 6 04-13-2007 10:43 PM
How to connect other PCs in RHEL4 using LAN sundararaman Linux - Networking 1 02-25-2007 08:03 PM
Can't access server using hostname from other PCs on the local network binister Linux - Software 5 09-01-2006 03:13 AM
Setting up a direct LAN between 2 PCs Mr_Nightmare Linux - Networking 3 08-31-2005 07:58 PM


All times are GMT -5. The time now is 05:37 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration