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 192.168.1.0/24

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

There it is. 192.168.1.114. 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
address 192.168.1.4
netmask 255.255.255.0
gateway 192.168.1.111

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 using Firefox 2.0.0.3 on Mac OS | 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 using Firefox 2.0.0.6 on Ubuntu | 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 using Firefox 2.0.0.6 on Ubuntu | 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 using Firefox 2.0.0.6 on Windows XP | 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 using Firefox 2.0.0.6 on Ubuntu | 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 using Firefox 2.0.0.6 on Ubuntu | August 4, 2007 at 10:56 am | Permalink

    Wouldn't using ddns work as well pretty nicely?

  7. Jason using Firefox 2.0.0.6 on Mac OS | August 6, 2007 at 10:39 am | Permalink

    @newback:
    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 using Firefox 2.0.0.6 on Windows XP | 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. [...] Original post by Aaron [...]

Post a Comment

Your email is never published nor shared.

Switch to our mobile site