Fixed IP address problems

Wouldn't that be more correctly termed "fixed-address dhcp" (in ISC parlance)[1]

OK, so the end result is similar in that the PI is always on the same IP address *as long as the dhcp server is available* - but to call that sort of setup "static IP" isn't quite right.

-Paul [1] Or static DHCP Assignment by DD-WRT, Address Reservation by Netgear, DHCP reservation or Static DHCP by Cisco and Linksys, and IP reservation or MAC/IP binding by various other router manufacturers[2] [2] According to wackypedia at least

--
http://paulseward.com
Reply to
LP
Loading thread data ...

Not all of them have it... Some support the concept of static IP, but handled by DHCP. So the router remembers the MAC address of the device and makes sure it always gives it the specified IP, and also never hands out that IP to other devices.

--
Cheers, 

John. 

/=================================================================\ 
|          Internode Ltd -  http://www.internode.co.uk            | 
|-----------------------------------------------------------------| 
|        John Rumm - john(at)internode(dot)co(dot)uk              | 
\=================================================================/
Reply to
John Rumm

One last thing to check if you have not done so already, it to make sure the address you have allocated is not inside the range of addresses that the router is allowed to used for DHCP -else its possible to get an address conflict.

--
Cheers, 

John. 

/=================================================================\ 
|          Internode Ltd -  http://www.internode.co.uk            | 
|-----------------------------------------------------------------| 
|        John Rumm - john(at)internode(dot)co(dot)uk              | 
\=================================================================/
Reply to
John Rumm

I wont argue the semantics, but that is how the OPS problem is must easily solved

--
Ineptocracy 

(in-ep-toc?-ra-cy) ? a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
Reply to
The Natural Philosopher

Thanks. I was aware of this and while I was searching the router's options for doing it I noticed an inconspicuous check box: "Always give same address to DHCP Clients". This seems to answer my prayers; DHCP, DNS and fixed IP address. Now all I have to do is get the router to save my changes, which it refuses to do although I have Administrator privileges.

Another Dave

Reply to
Another Dave

Statically allocated not fixed IP address, subtle but important distiction.

If the DHCP server is down the device won't get an IP address when it powers up, it *might* assume the last one it had is OK to use provided the lease (if it's remembered that as well) is still valid.

With a fixed IP address the device will power up and use that IP address regardless of the state of the DHCP server.

With the former the machine may or may not be accessable via it's static IP address, with the latter it will be.

--
Cheers 
Dave.
Reply to
Dave Liquorice

Vaguely associated issue I've just encountered.

The solution using a local (NAT?) router is to have the router assign a host name and IP address based on the MAC address of the network connection.

I've just moved my Pi from a wireless connection to Ethernet.

So the previous allocation of the MAC address no longer works and I'm back to DHCP.

So (my DNS being horribly rusty) how do you cope with the same system connecting at different times using different network interfaces?

Required behaviour being that MAC1, MAC2, MAC3 etc. are assigned the same IP address and host name when the system powers up, regardless of which is in use.

Cheers

Dave R

Reply to
David.WE.Roberts

I think that you might have to spoof the MAC address on one interface to be the same as the other. As accessing the router to assign the same IP address to two different MAC clients is probably nasty.

BUT what happens when you have a wired AND a wireless connection simultaneously?

play with this:

formatting link

--
Ineptocracy 

(in-ep-toc?-ra-cy) ? a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
Reply to
The Natural Philosopher

I'd use a static address. Then you don't need to think about assigning different MAC addresses to the same IP address or bother spoofing MAC addresses.

--
(\__/)  M. 
(='.'=) If a man stands in a forest and no woman is around 
(")_(") is he still wrong?
Reply to
Mark

There isn't a safe way to assign the same address to two different interfaces. However it is possible for a name to resolve to a list of addresses.

Using DHCP for both interfaces (with or without reservations) what should happen is:

Wireless only - the name is resolved to the IP assigned to the wireless interface Wired only - the name is resolved to the IP assigned to the wired interface Both connected - the name will resolve to one of them, probably the one which came up first, i.e. the wired one usually.

In each case accessing by NAME will work. Accessing by IP might not.

Do you really need a fixed IP address? Using the name is safer.

--
Alan Adams, from Northamptonshire 
alan@adamshome.org.uk 
http://www.nckc.org.uk/
Reply to
Alan Adams

generally you have two different IP addresses

running two DHCP servers on the same network is a recipe for confusion. especially when they issue leases different subnets or offer them on in the same range. If you have several devices capable of running DHCP servers only enable it on one of them.

--
?? 100% natural
Reply to
Jasen Betts

Enterprises do this all the time. But you have to be *careful* to do so, and put thought into your scopes.

Reply to
Doug McIntyre

Fortunately we weren't having to consider that, as the issue was two clients (on the same PC), not two servers. The worst that happens with one PC with two network interfaces is that local routing may get a little confused/indeterminate and you have to intervene.

Reply to
Rob Morley

My solution has been dnsmasq in the router since dnsmasq supports assigning the same IP address to multiple MACs. There's an example of this configuration in the dnsmasq manual and it specifically mentions a laptop with both wired and wireless interfaces as an example. Should work for an RPi just as well. Can't try with mine since I don't have a compatible wireless adapter for it.

Reply to
Anssi Saari

However I have a Virgin Media Superhub (possibly mis-named) where the web based management of the DHCP part is broken.

So unless I turn off the routing and just use this as an Ethernet connection I can't do as you suggest.

I would also need another dedicated PC (hmmm....would a Pi have enough power?) to be the platform for dnsmasq as a quick Google didn't turn up any routers which support it.

So an interesting approach but unless I was thinking of building some kind of server to act as Internet firewall, DNS server, DHCP server and router then possibly not practical for me.

Cheers

Dave R

Reply to
David.WE.Roberts

I've disabled the DHCP on my Virgin RubbishHub (but still use it as a router). I run dnsmasq on an ancient Dell Laptop with a Celeron CPU and

384MB of RAM. It also runs NTP, Apache, Mediawiki, a print and file server and MySQL. It handles this fairly well (the MediaWiki is the slow service), so a Pi won't even break a sweat :)

In fact I used to run most of those services on a couple of P1MMX 166MHz laptops with 32MB each.

Reply to
Dom

Using Ethernet and configuring the RPi to use a static address may be your easiest solution.

An RPi should certainly have ample power to act as a DNS and/or DHCP server and/or to run dnsmasq for your local network.

I assume that your router does NAT, i.e. translates between your external static IP or the dynamic IP your ISP assigns? Provided that you don't do any port forwarding on your router (and there's no need for that unless you're running services that need to be accessible from the internet at large) than a router running NAT is actually rather an effective firewall.

I do more or less that: I use my ancient NAT-capable router as my firewall. I assign static IPs to the computers on my LAN and one of my Linux PCs runs named to provide DNS services: this is definitive for host names in the LAN and also caches external IP:hostname details, which makes all Internet access a lot faster.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
org       |
Reply to
Martin Gregorie

I should have added that I used to run:

- Apache (an internal LAN-only web server)

- named (LAN DNS services)

- Postfix (local mailserver) along with - getmail (picks up my incoming main using POP3) - Spamassassin (antispam filter) - dovecot (POP3 mail server for my LAN)

- Postgres (RDBMS used as a mail archive)

- squeezeboxserver (local media server to backend a Squeezebox Touch)

on an 866 MHz, P3 box with 512 MB RAM running Fedora Linux. It handled all this easily, with enough grunt left over to develop in Java or C over multiple ssh connections if I felt like writing code on it.

It only got replaced (about 18 months ago) when RedHat suddenly introduced a new Fedora installer that refused to run in less than 1GB of RAM. The old P3 box was already fully stuffed with its 512MB.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
org       |
Reply to
Martin Gregorie

On 14/07/2013 12:46, David.WE.Roberts wrote: []

[]

To avoid the need for reconfiguring every time VM changes something on their box, I run mine in bridge mode rather than as a router. For my router, I have the excellent TP-Link WR1043ND box:

formatting link
formatting link

running DD-WRT software, and I actually have a separate wireless access point based on a Netgear WNR2000 v2 (also supplied by VM at some point in the past). Thus MAC-address Wi-Fi access control can live just on the Netgear box, routing can live on the TP-Link box together with SNMP throughput monitoring (which VM don't allow you to access on their box, despite imposing bandwidth limits based on the amount of transfers you have), and the VM box just acts like a bridge as the older Motorola SB5101E it replaced.

It seems to work well, and offers download speeds up to my service limit of 60 Mb/s.

--
Cheers, 
David 
Web: http://www.satsignal.eu
Reply to
David Taylor

Maybe you could just turn off the DHCP server part?

RPi is easily powerful enough to run dnsmasq. Considering my old Linksys WRT54GS router ran it just fine and it had a 200 MHz MIPS processor, 32 MB RAM.

Most routers running Linux presumably run dnsmasq too. Buffalo ones definitely do. Although the web management interface usually isn't flexible enough to allow for this setting. I upgraded my recent purchase of Buffalo WZR-HP-AG300H to OpenWRT Linux. The web thingy there isn't capable either but at least the OpenWRT devs are smart enough to understand this and allow extra settings to be read from a config file.

I have to admit my setup doesn't seem to be working with my new laptop although it was working in my old one. Seems like NetworkManager is doing something stupid.

Reply to
Anssi Saari

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.