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 19:20, bad apple wrote:
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.

Hi Bad Apple,

This was definitely the problem. ***Learning has occurred *** :-)


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
Fair point. Even as a low grade linux user I would still prefer to use a command line wherever possible. This assumes that the command line task I am attempting uses the current (up-to-date) method(s) and is no harder than it's gui alternative. In this case it seems I was better off using the gui program - as you have rightly pointed out lol. Thank you :-)

- 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.
Hmmm, point taken....

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.
Brill. Thanks. I get this now, and am pretty chuffed i do!

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.
Yarp
  You're
probably (?) not planning on using SSH to access the Android phones for
example, so they could quite happily remain on DHCP.

Narp
  You probably *do*
want to access the laptops and printer regularly from other devices
though, so they should all be on static assignments.
Yarp

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

Yes that's great. Thanks Bad Apple. I was aware of /etc/hosts - I think you mentioned it in the security thread..



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".

Coool :-)

*Don't* add
duplicate entries: so on your netbook atomiser, it will already have
it's own entry included in the hosts file,
No!? it does not seem to have it's own entry? Unless it looked like "127.0.1.1 Atomiser", which I subsequently deleted since I thought it was added by me a long time ago, when messing about! (Yes, I will stick to gui tools lol lol) I definately could be wrong? lol. My /etc/hosts file is shown below...

--------------------------------------------------
127.0.0.1       localhost

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

# Roly's additions
192.168.1.1     Router
192.168.1.2     Atomiser
192.168.1.3     Phoneix
192.168.1.4     Nemisis
---------------------------------------------------

The example, below, does not seem to include its own entry? Please explain? and sorry if this is really simple / boring for other readers!

http://community.linuxmint.com/tutorial/view/159

  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!
roger.

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

Bad Apple and everyone else, I have learnt quite a lot from this thread - simple though it may be. So thank you all very indeed.

Best wishes & merry xmas
Roly :-)

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

balls! haha!

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