Skip to content

Commit

Permalink
Add more descriptive instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanKuchin authored Jan 26, 2024
1 parent 777eb94 commit bc9c909
Showing 1 changed file with 63 additions and 2 deletions.
65 changes: 63 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ Small script synchronizes phpipam hosts with pi-hole resolvers.

## Use case

Phpipam considered source of truth for DNS resolution. Network admins create hostnames in phpipam.
Pihole used as a DNS-server.
Phpipam considered to be a source of truth for DNS resolution.
* Network admins create hostnames in phpipam.
* Pihole used as a DNS-server.
* (optional) Cisco router acts as a DHCP-server

To synchronize phpipam hostanmes with pihole DNS-resolver
```
phpipamsync get pi-hole
Expand All @@ -26,3 +29,61 @@ pi_hole: /home/ikuchin/docker/pi.hole/etc-pihole/custom.list # full path to p
```

**ATTENTION** pi-hole custom file will be rewritten, not appended.

## phpipam API token

To generate API topken, in phpipam go to Administration -> API -> Create API token.

* Type - SSL with App code token
* App permission - Read

Important: HTTPS access should be enabled to phpipam

## Cisco DHCP config

To generate DHCP config snippet for Cisco router configuration

```
phpipamsync get cisco-dhpc
```

Once snippet generated it can be copy/paste-ed to actual router configuration. There is no integration between phpipamsync and router.

## Examples

### DNS resolution

```
e:\docs\src\go\phpipamsync>nslookup tesla.home
...
Non-authoritative answer:
Name: tesla.home
Address: 192.168.168.49
e:\docs\src\go\phpipamsync>nslookup 192.168.168.49
...
Name: tesla.home
Address: 192.168.168.49
```

### Cisco IOS DHCP config

ClientID generated from either of options below:
* MAC address (by adding prefix 01.....)
* Custom field named ClientID ( Administration -> Custom fields -> Custom IP addresses fields )

```
$ phpipamsync get cisco-dhcp
ip dhcp pool fridge
host 192.168.251.13 255.255.255.0
client-identifier 0170.2c1f.3ed2.cb
default-router 192.168.251.1
!
ip dhcp pool tesla
host 192.168.168.49 255.255.255.0
client-identifier 014c.fcaa.8ec6.62
default-router 192.168.251.1
!
```

0 comments on commit bc9c909

Please sign in to comment.