D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Assigning Static IP addresses on Mint 12

 

On 24/12/12 17:20, Roland Tarver wrote:
> Hi Folks!
>
> MERRY XMAS!
>
> Following on from the relatively recent  (and excellent thread on
> security) I have been trying to assign static IP addresses the
> machines on my tiny home network:-
>
> My netbook. (atomiser) (wireless)
> My 17" laptop (nemisis) (wireless)
> Mum's Laptop (phoenix) (wireless)
> The network printer (wired) (HP)
> And, of course the wireless router, a Huawei EchoLife HG520s
> + several android phones (so cannot turn off DCHP all together?)
>

As others have said, you've mostly got this right - your ability to ping
by IP address but not by hostname is definitely a lack of name server
resolution. As Philip stated, your router will be your network gateway
and will be providing DNS lookups as well.

Regarding manual configuration of modern distros like Mint, Ubuntu, etc,
you're really better off using the GUI tools if by your own admission
you're not a networking guy - there are a lot of potential minefields
with outdated tutorials out there. The location of certain critical
files (such as /etc/resolv.conf, which historically has always contained
your DNS server settings is now a symbolic link to a dynamically
generated file at /run/resolvconf/resolv.conf for example) is no longer
consistent and non initscript-based systems also complicate networking
with - in my opinion - stupid and unpredictable behaviour.

If you use the network-manager connection tool under Mint/Ubuntu,
configuration should be simple and persistent across reboots so you're
almost definitely better off sticking with that until you're more
comfortable with networking.

Sounds like you've pretty much got it all working though - your network
sounds like it's configured as follows:

router: 192.168.1.1 (also known as the gateway)
netmask 255.255.255.0 (also known as subnet)
DNS: 192.168.1.1 (this is being served by your router as well)
DHCP scope: 192.168.1.20-254 (this gives you 234 potential simultaneous
leases, which is a lot)

All clients you're configuring with static network configs should
obviously have a unique address in the range 192.168.1.2-19 (the router
is of course at 192.168.1.1). Their subnet mask/netmask should be set to
255.255.255.0 and the gateway and DNS values should both be set to
192.168.1.1. You can alternatively specify a 3rd party DNS server such
as the google ones (8.8.8.8) or OpenDNS (208.67.222.222) if you'd like
for any reason as you're not using local DNS for anything.

It's perhaps worth pointing out that you only really need static setups
for machines that you're planning to access regularly from other clients
- probably the actual computers, the printer and the router. You're
probably (?) not planning on using SSH to access the Android phones for
example, so they could quite happily remain on DHCP. You probably *do*
want to access the laptops and printer regularly from other devices
though, so they should all be on static assignments.

Lastly, you probably know this already, but you can add entries to your
/etc/hosts file on linux boxes to setup easy aliases for accessing your
static machines, for example:

192.168.1.1    router
192.168.1.2    printer
192.168.1.3    atomiser
192.168.1.4    nemisis

Add these entries to the bottom of your hosts file, and from then on,
you could "ssh atomiser" rather than "ssh 192.168.1.3". *Don't* add
duplicate entries: so on your netbook atomiser, it will already have
it's own entry included in the hosts file, don't add it again (this can
cause glitches). Definitely DON'T even think about touching the
"127.0.0.1 localhost" loopback entry already there, it may look strange
but trust me, it's supposed to be there!

Hope that all makes sense, you've probably fixed it all by now anyway.
Any more questions, just ask!

Cheers


PS: sorry to be "that guy", but you spelt 'nemesis' wrong...

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq