D&C GLug - Home Page

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

[LUG] Assigning Static IP addresses on Mint 12

 

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?)

Mum has a constant problem of not being able to print via the network (wirelessly). I have assumed that this problem is because the IP address of the printer is dynamically assigned - and so keeps changing. Re-detecting / installing the printer from mums laptop cures the problem, until the printer gets a different IP address once more....

Also, from the recent security thread many suggested that static IP address were of great use for SSHing between boxes on the network et al. So, it sounds like static IPs will suit me well. I have been trying fairly hard to set them up and have followed some of advice Julian provided in the security thread....

"Julian Hall <linux@xxxxxxxxxxxx>     Sat, Nov 3, 2012 at 11:46 AM
Reply-To: list@xxxxxxxxxxxxx
To: list@xxxxxxxxxxxxx
 On 03/11/2012 23:28, Martijn Grooten wrote:

    On Sat, Nov 3, 2012 at 11:18 PM, Neil Winchurst wrote:

I do not have a static set up for the router. I have checked my ISP's website and they will provide it but it will cost 'extra'. I have not
        yet checked the cost, will ring them tomorrow.

    I think what bad apple meant was for your machines to have a static
    _internal_ IP address. (One that usually, but not always, starts with
    192.168.) I agree it can be useful for all machines to have a fixed
    local IP address, but for an average user it's not essential.

    Most routers can give the same IP address to the same machine every
    time, which in practise gives you static addresses. I think that's
    good enough.

Three ways of achieving that;

a) Turn off the router's DHCP server and assign all machines static internal IPs. Will cause problems for anyone who visits you should they want access to the internet e.g. on a smartphone etc. Come to think of it I don't think you can give any smartphone or a(ndroid) tablet a static IP at all, so if you plan on using one on WiFi for these this is not the option for you. (I'm open to being corrected on the latter point).

b) Shift the IP range of the DHCP server up enough to allow space for the machines you already have, and then assign them static IPs. e.g.

router IP range 192.168.0.2 -> 192.168.0.50

Alter the range to 192.168.0.5 -> 192.168.0.50 :- That gives you three free IP addresses at the bottom of the range to assign static to a desktop and two laptops - 192.168.0.2/3/4.

If however you add more machines at a later date you have to fiddle with the range again, potentially screwing up current connections.

c) Use IP reservations (assuming the function is available on your router. This tells the router to give the same IP addresses to equipment based on their MAC addresses. For example on my home system my desktop, WiFi printer and NAS all have reserved IPs, so as far as the network is concerned they're fixed. However my phone and tablet cannot so they're dynamic and able to use the range available above the reservations, as is anyone who visits. You still have to alter the reservations if you change equipment, but only on devices that change.

Julian"


I am going for option (b), since there are android smart phones that also connect to the network and since my router does not seem to support IP resevations.

I have successfully moved the starting point of the DCHP range upward from: 192.168.1.2 to 192.168.1.20

Hopefully this will give me 18 free IP addresses that can be assigned in a static manor? After making this change "ifconfig wlan0" for my netbook looks like this (another device was on IP 192.168.1.20):-

wlan0     Link encap:Ethernet  HWaddr 00:21:63:a3:c3:d3
          inet addr:192.168.1.21  Bcast:192.168.1.255 Mask:255.255.255.0
          inet6 addr: fe80::221:63ff:fea3:c3d3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11376 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9864 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9848895 (9.8 MB)  TX bytes:1423031 (1.4 MB)


I then thought - ok, how do I actually assign a static IP address for my netbook? (never done it before). I was following:-

http://www.cyberciti.biz/faq/howto-configuring-network-interface-cards-on-debian/

This was not working however. I then discovered:-

http://forums.linuxmint.com/viewtopic.php?t=102603&f=150

Even though Mint is based on ubuntu (debian), apparently it assigns static IPs differently - via the graphical (grumble) nm-connection-editor. Which, to my mind, adds un-necessary gui fluff around a perfectly good cli method. But hey, what do i know.....

So, I have used nm-connection-editor to set up a manual connection for my netbook, with the following details:-

IP address : 192.168.1.2
Net Mask : 255.255.255.0
Gateway : 192.168.1.1   (address of my router??!)

I know virtually nothing about networking, does the net mask and gateway IP addresses seem correct please?

The current state of play when using the above configuration is:-

roly@Atomiser ~ $ ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:21:63:a3:c3:d3
          inet addr:192.168.1.2  Bcast:192.168.1.255 Mask:255.255.255.0
          inet6 addr: fe80::221:63ff:fea3:c3d3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13280 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11818 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10835923 (10.8 MB)  TX bytes:1742174 (1.7 MB)

roly@Atomiser ~ $ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_req=1 ttl=254 time=4.56 ms
64 bytes from 192.168.1.1: icmp_req=2 ttl=254 time=1.11 ms
64 bytes from 192.168.1.1: icmp_req=3 ttl=254 time=1.14 ms
^C
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.110/2.273/4.568/1.623 ms


roly@Atomiser ~ $ ping www.google.co.uk
ping: unknown host www.google.co.uk


So, I seem to have assigned a static IP address and am able to ping my router - but cannot get to the internet.

I have looked through most of configuration pages on the router and I cannot see anything obvious that I should be enabling or disabling. What am I mis-understanding / doing wrong please?

Many thanks guys. :-)
Merry xmas
roly :-)

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