Image of the glider from the Game of Life by John Conway
Skip to content

Why I Prefer Linux- It's The Tools

I have my laptop sitting at my desk at home. I need a file, so I launch SSH, only to find out that I can't connect. Then I remember that the last time I booted, I received a DHCP address from my router. I have no idea what the address is that is assigned, and as such, can't access the OpenSSH server on my laptop to get what I need. So, thanks to the help of a friend, I use nmap to do a ping sweep in my LAN, to find out what IP was assigned:

aaron@achilles:~$ nmap -sP

Starting Nmap 4.20 ( ) at 2007-08-03 11:04 MDT
Host achilles ( appears to be up.
Host hercules ( appears to be up.
Host appears to be up.
Nmap finished: 256 IP addresses (3 hosts up) scanned in 2.288 seconds

There it is. That would've taken a while to find by hand. Next thing to do, is SSH into hercules, and change the IP to it's normal static IP that it should be. This is easy, by just opening /etc/network/interfaces and adding and saving the following:

iface eth0 inet static

Last thing that needs to be done? Restart networking:

root@hercules:~$ ifdown eth0;ifup eth0

Now I can SSH and SCP the file I need, going about my way. Beautiful.

{ 8 } Comments

  1. Michael Greb | August 3, 2007 at 11:27 am | Permalink

    You might also concider something like avahi. With avahi running on all of my Linux boxes, and Apple mDNSresponder stuffs on the other couple of OS X boxes, I've gone back to dhcp for all of the IPs on my lan save one that needs some ports forwarded to it. Plus, I don't have to worry about updating /etc/hosts on each box all the time o/.

  2. Timo Zimmermann | August 3, 2007 at 11:49 am | Permalink

    if you would live in Germany you would be acting against the new law (at least how everyone think it works) that says "don't use hacker tools like nmap" - you should post a disclaimer that this is not a suitable solution for everyone *scnr*

  3. Aaron | August 3, 2007 at 12:08 pm | Permalink

    @Timo Zimmerman- It's against the law to use these tools even on your own local network, eh? Glad I don't live in Germany then. 🙂

  4. Anonymous | August 3, 2007 at 12:18 pm | Permalink

    I second the comment about avahi. Except for my public-facing compute r (which is a static IP because i forward some ports to it from the router), all my others just use avahi so I can ssh between them with computername.local and not have to worry about setting up the static IP correctly. This has the added benefit that you don't have to remember any IP addresses or worry about a /etc/hosts file or anything like that -- it just works.

  5. Marius Gedminas | August 4, 2007 at 2:22 am | Permalink

    If you have Ubuntu Feisty on your machines, avahi is enabled by default, so you can just use yourhostname.local addresses.

  6. new back | August 4, 2007 at 10:56 am | Permalink

    Wouldn't using ddns work as well pretty nicely?

  7. Jason | August 6, 2007 at 10:39 am | Permalink

    No, because we're dealing in Private Addresses, not Public ones.

    DDNS (at least, traditionally) asks an external server to tell it what it's IP address is from the outside world, and from the outside world, they'd all only ever return 1 IP.

  8. new back | August 9, 2007 at 4:16 am | Permalink

    Jason, that is only due specific environment. You can have your own dns servers or actually have external addresses for every computer. Myself, I never have anything natted or internal networks. I see no reason as I have been given enough ip addresses.

    I agree with you, what you describe is what most of the people have.

{ 1 } Trackback

  1. » Why I Prefer Linux- It’s The Tools | August 3, 2007 at 10:32 am | Permalink

    [...] Original post by Aaron [...]

Post a Comment

Your email is never published nor shared.