On 2016/06/07 14:39, Gerhard Roth wrote: > > > Now I get an IP address from my provider, I want something like this: > > > > > > inet 10.75.178.41 --> 10.75.178.42 netmask 0xfffffffc > > > > > > But if I used SIOCAIFADDR I would get this instead: > > > > > > inet 0.0.0.1 --> 0.0.0.2 netmask 0xff000000 > > > inet 10.75.178.41 --> 10.75.178.42 netmask 0xfffffffc > > > > > > And deleting the old one first seems more racy. > > > > Why? > > Because either there is a time without any IP address or there > is one with two addresses. Neither seems right.
Is there a problem to have no address? That is what happens with gif(4), tun(4) etc, even with ethernet interfaces, when they don't have a particular address configured on them. There doesn't seem a particular problem with dhclient removing the old address before it adds a new one.. > See above. That's the current OpenBSD model for PPP. There are several models :-) The 0.0.0.1 thing is a specific hack for sppp/pppoe which has "magic" values of 0.0.0.0 and 0.0.0.1 and a way to request a specific hardcoded address. This is because *both* sides propose addresses via IPCP (they are "equal" peers as far as configuration is concerned), they have to agree and can NAK each other. It's not the only way though, even for PPP; ppp(4) doesn't use this mechanism, it has separate configuration for pppd instead. When we had ppp(8), that didn't, either. As far as I understand MBIM addressing is driven from the "mobile network" side, we just set the address they are telling us to use without a way to propose our own address. If that's correct then we don't need a way to set "our side's" address at all, or have a way to tie down the remote side's address, so address configuration can be a lot simpler than any PPP interface. > > But when you lose the connection with the network or you manually set > > the interface down, this IP address once given to you by the provider > > is no longer yours and must not be used anymore. The same can apply in other cases (wifi, wired ethernet etc) too, but we don't do anything to remove it from those interfaces (though it's easy enough to remove using ifstated if needed).
