insomniac 7 éve
szülő
commit
69e5684c84
1 módosított fájl, 43 hozzáadás és 0 törlés
  1. 43 0
      README.md

+ 43 - 0
README.md

@@ -27,3 +27,46 @@ server6:
 ```
 
 See also [config.yml.example](config.yml.example).
+
+## Build and run
+
+Once you have a working configuration in `config.yml`, you can build and run the server:
+```
+$ go build
+$ sudo ./coredhcp
+2018/12/19 14:27:17 Registering plugin "file"
+2018/12/19 14:27:17 Registering plugin "server_id"
+2018/12/19 14:27:17 Loading configuration
+2018/12/19 14:27:17 Found plugin: `server_id` with 2 args, `[LL 00:de:ad:be:ef:00]`
+2018/12/19 14:27:17 Found plugin: `file` with 1 args, `[leases.txt]`
+2018/12/19 14:27:17 Loading plugins...
+2018/12/19 14:27:17 Loading plugin `server_id`
+2018/12/19 14:27:17 plugins/server_id: loading `server_id` plugin
+2018/12/19 14:27:17 plugins/server_id: using ll 00:de:ad:be:ef:00
+2018/12/19 14:27:17 Loading plugin `file`
+2018/12/19 14:27:17 plugins/file: reading leases from leases.txt
+2018/12/19 14:27:17 plugins/file: loaded 1 leases from leases.txt
+2018/12/19 14:27:17 Starting DHCPv6 listener on [::]:547
+2018/12/19 14:27:17 Waiting
+2018/12/19 14:27:17 Server listening on [::]:547
+2018/12/19 14:27:17 Ready to handle requests
+...
+```
+
+Then try it with the local test client:
+```
+$ cd client
+$ go build
+$ sudo ./client
+2018/12/19 14:29:05 &{ReadTimeout:3s WriteTimeout:3s LocalAddr:[::1]:546 RemoteAddr:[::1]:547}
+2018/12/19 14:29:05 DHCPv6Message
+  messageType=SOLICIT
+  transactionid=0x6101f0
+  options=[
+    OptClientId{cid=DUID{type=DUID-LLT hwtype=Ethernet hwaddr=00:11:22:33:44:55}}
+    OptRequestedOption{options=[DNS Recursive Name Server, Domain Search List]}
+    OptElapsedTime{elapsedtime=0}
+    OptIANA{IAID=[250 206 176 12], t1=3600, t2=5400, options=[]}
+  ]
+...
+```