# openrc+network+dhcpcd and dyndns (e.g. ez-ipupdate)

## mv

Hello:

As the subject say, I receive my internet connection via some router using in openrc the scripts /etc/init.d/network (for the local net) and /etc/init.d/dhcpcd (for the external connection).

dhcpcd uses iproute2 or something similar to set the current IP adress so that e.g. it does not show up with "ifconfig eth0" but only as a second entry to eth0 with "ip addr show" (the first entry is the local adress which I have set with /etc/init.d/network).

I want to "publish" my current ip-address using dyndns.org. Unfortunately, ez-ipupdate seems to be using some equivalent of ifconfig so that it only "publishes" my local network address which ifconfig shows for eth0, not the address received by dhcpcd.

Is there some way to tell ez-ipupdate (without patching it) where to find the correct address?  Or if this is not possible, is there some alternative to ez-ipupdate which can do this?

----------

## tgR10

did you try ddclient ? it works with dyndns

from ddclient config file

```
## To obtain an IP address from FW status page (using fw-login, fw-password)

#use=fw, fw=192.168.1.254/status.htm, fw-skip='IP Address' # found after IP Address

#

## To obtain an IP address from Web status page (using the proxy if defined)

#use=web, web=checkip.dyndns.org/, web-skip='IP Address' # found after IP Address

#

#use=ip,                     ip=127.0.0.1   # via static IP's

#use=if,                     if=eth1      # via interfaces

use=web               # via web
```

i'm not using it because i got my modem connectet straight to the server so i don't need it, but i'm pretty sure it will work

----------

## mv

 *tgR10 wrote:*   

> did you try ddclient ?

 

Thanks. This will probably work, although I am not too enthusiastic running perl as a daemon and having to connect to external links regularly to find out my ip. I think there should be a solution with less demands for hardware and connection...

I am currently seriously thinking about patching ez-ipupdate. It seems to use some ioctl(socket(AF_INET, SOCK_STREAM, 0), SIOCGIFADDR, ...) call in its get_if_addr() function to get the ip. After some research I think I have to replace this somehow with ioctl(socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE), RTM_GETADDR, ...) until I get an address which is known not to be local. However, I think there must be code existing for this: I can hardly imagine that I am the first one to run into this problem...

----------

## mv

A patch for ez-ipupdate can be found in this bugreport

----------

## mv

An ebuild with a current version of the patch is available in the mv overlay (which can be installed via layman).

----------

