The DHCPC resource can retrieve the ip address when abilis is used as dhcp client.
Add the resource to the Abilis system; the DHCP resource may already exist in the system, but may not yet be active: set it active with the command s act res:dhcp.
[09:47:27] ABILIS_CPX:a res:dhcpc
COMMAND EXECUTED
Caution | |
---|---|
After adding or setting the DHCPC active, you must restart the Abilis to make the resource running (use the command warm start to reboot the Abilis). |
[09:48:58] ABILIS_CPX:s p dhcpc act:yes
COMMAND EXECUTED
RES:DhcpC - Not Saved (SAVE CONF), Not Refreshed (INIT) -----------------------
------------------------------------------------------------------------
Run DESCR:Dynamic_Host_Configuration_Protocol_Client
LOG:DS ACT:YES msg-len:1472
cli-udp-locport:68 srv-udp-remport:67 TOS:0-N
DHCP-SERVER:* DHCP-SERVER-LIST:#
The default parameters suffice to make the resource to work properly.
The most important parameters are:
[10:45:42] ABILIS_CPX:_d p dhcpc
RES:DhcpC --------------------------------------------------------------------- Run DESCR:Dynamic_Host_Configuration_Protocol_Client LOG:DS ACT:YES msg-len:1472 cli-udp-locport:68 srv-udp-remport:67 TOS:0-N DHCP-SERVER:* DHCP-SERVER-LIST:# [10:51:42] ABILIS_CPX:_d p dhcpc ?
DhcpC resource parameter(s): DESCR: Resource description [Max. 80 aphanumeric extended characters] LOG: State changes log and alarm generation [NO, D, S, A, L, T, ALL] [+E] (D: Debug Log; S: System Log; A: Alarm view; L: Local audible alarm; T: SNMP traps; +E: Extended Log of state changes, see ref. manual) ACT: Operation activation [NO, YES] msg-len: Maximum length of DHCP message, actually the UDP payload [548..2048] cli-udp-locport: Client UDP port [68] <Read Only> srv-udp-remport: DHCP Server UDP port [67] <Read Only> TOS: Type Of Service octet or Differentiated Services Field (DS): -' p-t', i.e. PRECEDENCE and TOS values, where 'p' can be [0..7] and 't' can be [N=None, D=Min. Delay, T=Max. Throughput, R=Max. Reliability, C=Min. Monetary Cost] - 'bbbbbb', i.e. DS value bit by bit, where 'b' can be [0, 1] DHCP-SERVER: DHCP Server IP address [*, 1-126.x.x.x, 127.0.0.1, 128-223.x.x.x] DHCP-SERVER-LIST: Name of an IP/IR/RU/MR list of DHCP Server IP addresses [#, 0..9, a..z, A..Z, _]
Refer to Section 68.15.3, “How to activate the DHCP in client mode” to view a further example of configuration.
Configure the DHCPC and IP-2 resources so that Abilis retrieves the ip address from the ADSL router. The first step is to activate the DHCPC resource and then optionally configure the DHCP-SERVER parameter:
[16:43:03] ABILIS_CPX:_s p dhcpc dhcp-server:192.168.1.254
COMMAND EXECUTED [16:43:33] ABILIS_CPX:_d p dhcpc
RES:DhcpC - Not Saved (SAVE CONF), Not Refreshed (INIT) ----------------------- ------------------------------------------------------------------------ Run DESCR:Dynamic_Host_Configuration_Protocol_Client LOG:DS ACT:YES msg-len:1472 cli-udp-locport:68 srv-udp-remport:67 TOS:0-N DHCP-SERVER:192.168.001.254 DHCP-SERVER-LIST:#
Now IP-2 resource must be configured to use DHCP. Display diagnostics for IP-2 resource helps to view the retrieved ip address:
[16:48:46] ABILIS_CPX:_s p ip-2 ipadd:dhcp
COMMAND EXECUTED [16:48:58] ABILIS_CPX:_d p ip-2
RES:Ip-2 - IP over LAN (LAN) -------------------------------------------------- Run DESCR:WAN OPSTATE:UP LOG:NO STATE-DETECT:NORMAL LANRES:Eth-2 IPADD:DHCP DHCP-GW:YES DHCP-GW-AD:2 DHCP-DNS:YES REDIS:EXT HIDE:NO RP:NONE IPSEC:NO VRRP:NO NAT:INSIDE UPNP:NO DIFFSERV:NO DDNS:NO OUTBUF:100 OUTQUEUE:FAIR MTU:1500 BRD:NET OUTSPL:NO INBUF:0 mru:1500 SRCV:NO - TRFA section --------------------------------------------------------- TRFA:NO - Lan ------------------------------------------------------------------ LLOG:NO arpcache:200 CACHETIMER:120 rxbuf:4 txbuf:14 VLAN-ID:UNTAG RES:Eth-2 --------------------------------------------------------------------- Run DESCR: LOG:DS MODE:AUTO DUPLEX:HALF dma-rxbuf:250 dma-txbuf:25 max-vlans:25 ip-rxbuf:25 arp-rxbuf:5 pppoed-rxbuf:5 pppoes-rxbuf:25 [16:49:04] ABILIS_CPX:_d d ip-2
RES:Ip-2 - IP over LAN (LAN) -------------------------------------------------- WAN STATE:UP LINK-STATE:LINKREADY CUR-IPADD:192.168.001.100 CUR-MASK:255.255.255.000 OUTBUF:100 S-OUTBUF:500 CUR-OUTSP:N/A OUTSP-TOUT:N/A INBUF:0 S-INBUF:0 CUR-INSP:N/A INSP-TOUT:N/A SPL-OVERHEAD:RAW-IP,ETH - Lan ------------------------------------------------------------------ STATE:LINKREADY ARP-CACHE-ITEMS:1
There are three other parameters which can be used to fit the configuration to needs:
DHCP-GW
Retrieve default gateway through DHCP [NO, YES]. Default value is YES.
DHCP-GW-AD
Administrative distance assigned to the default route obtained from a DHCP server [0..255]. Default value is 0.
DHCP-DNS
Retrieve primary and secondary DNS server through DHCP [NO, YES]. Default value is YES.
For example, configure IP-2 resource in the following way to retrieve only ip address and default gateway:
[17:05:54] ABILIS_CPX:_s p ip-2 dhcp-gw:yes dhcp-dns:no
COMMAND EXECUTED [17:07:53] ABILIS_CPX:_init res:ip-2
COMMAND EXECUTED [17:08:15] ABILIS_CPX:_d p ip-2
RES:Ip-2 - IP over LAN (LAN) -------------------------------------------------- Run DESCR:WAN OPSTATE:UP LOG:NO STATE-DETECT:NORMAL LANRES:Eth-2 IPADD:DHCP DHCP-GW:YES DHCP-GW-AD:2 DHCP-DNS:NO REDIS:EXT HIDE:NO RP:NONE IPSEC:NO VRRP:NO NAT:INSIDE UPNP:NO DIFFSERV:NO DDNS:NO OUTBUF:100 OUTQUEUE:FAIR MTU:1500 BRD:NET OUTSPL:NO INBUF:0 mru:1500 SRCV:NO - TRFA section --------------------------------------------------------- TRFA:NO - Lan ------------------------------------------------------------------ LLOG:NO arpcache:200 CACHETIMER:120 rxbuf:4 txbuf:14 VLAN-ID:UNTAG RES:Eth-2 --------------------------------------------------------------------- Run DESCR: LOG:DS MODE:AUTO DUPLEX:HALF dma-rxbuf:250 dma-txbuf:25 max-vlans:25 ip-rxbuf:25 arp-rxbuf:5 pppoed-rxbuf:5 pppoes-rxbuf:25 [17:08:18] ABILIS_CPX:_d ipr
Destination routes and conditional source routes: +-+-+-+-+--------------------+--------------------+-----------------+----+---+ |B|P|S|H| NET:/MASK: | MASK: or | GW: or |IP: |AD:| | | | | | | SRNET:/SRMASK: | IPLB: | | | +-+-+-+-+--------------------+--------------------+-----------------+----+---+ |*|C| |*| 127.000.000.001/32 | 255.255.255.255 | |LOOP| 0| |*|C| | | 192.168.030.001/32 | 255.255.255.255 | |R-ID| 0| |*|C| | | 010.000.000.000/29 | 255.255.255.248 | | 12| 0| |*|C| | | 192.168.000.000/24 | 255.255.255.000 | | 11| 0| |*|C| | | 192.168.001.000/24 | 255.255.255.000 | | 2| 0| |*|S| | | 192.168.008.000/24 | 255.255.255.000 | |D 10| 1| |*|C| | | 192.168.030.000/24 | 255.255.255.000 | | 1| 0| |*|C| | | 000.000.000.000/0 | 000.000.000.000 | 192.168.001.254 | 2| 0| +-+-+-+-+--------------------+--------------------+-----------------+----+---+
In some cases it's useful to retrieve only ip address:
[17:11:15] ABILIS_CPX:_s p ip-2 dhcp-gw:no
COMMAND EXECUTED [17:20:18] ABILIS_CPX:_init res:ip-2
COMMAND EXECUTED [17:20:29] ABILIS_CPX:_d p ip-2
RES:Ip-2 - IP over LAN (LAN) -------------------------------------------------- Run DESCR:WAN OPSTATE:UP LOG:NO STATE-DETECT:NORMAL LANRES:Eth-2 IPADD:DHCP DHCP-GW:NO DHCP-GW-AD:2 DHCP-DNS:NO REDIS:EXT HIDE:NO RP:NONE IPSEC:NO VRRP:NO NAT:INSIDE UPNP:NO DIFFSERV:NO DDNS:NO OUTBUF:100 OUTQUEUE:FAIR MTU:1500 BRD:NET OUTSPL:NO INBUF:0 mru:1500 SRCV:NO - TRFA section --------------------------------------------------------- TRFA:NO - Lan ------------------------------------------------------------------ LLOG:NO arpcache:200 CACHETIMER:120 rxbuf:4 txbuf:14 VLAN-ID:UNTAG RES:Eth-2 --------------------------------------------------------------------- Run DESCR: LOG:DS MODE:AUTO DUPLEX:HALF dma-rxbuf:250 dma-txbuf:25 max-vlans:25 ip-rxbuf:25 arp-rxbuf:5 pppoed-rxbuf:5 pppoes-rxbuf:25 [17:20:33] ABILIS_CPX:_d ipr
Destination routes and conditional source routes: +-+-+-+-+--------------------+--------------------+-----------------+----+---+ |B|P|S|H| NET:/MASK: | MASK: or | GW: or |IP: |AD:| | | | | | | SRNET:/SRMASK: | IPLB: | | | +-+-+-+-+--------------------+--------------------+-----------------+----+---+ |*|C| |*| 127.000.000.001/32 | 255.255.255.255 | |LOOP| 0| |*|C| | | 192.168.030.001/32 | 255.255.255.255 | |R-ID| 0| |*|C| | | 010.000.000.000/29 | 255.255.255.248 | | 12| 0| |*|C| | | 192.168.000.000/24 | 255.255.255.000 | | 11| 0| |*|C| | | 192.168.001.000/24 | 255.255.255.000 | | 2| 0| |*|S| | | 192.168.008.000/24 | 255.255.255.000 | |D 10| 1| |*|C| | | 192.168.030.000/24 | 255.255.255.000 | | 1| 0| +-+-+-+-+--------------------+--------------------+-----------------+----+---+ [17:20:57] ABILIS_CPX:_d d ip-2
RES:Ip-2 - IP over LAN (LAN) -------------------------------------------------- WAN STATE:UP LINK-STATE:LINKREADY CUR-IPADD:192.168.001.100 CUR-MASK:255.255.255.000 OUTBUF:100 S-OUTBUF:500 CUR-OUTSP:N/A OUTSP-TOUT:N/A INBUF:0 S-INBUF:0 CUR-INSP:N/A INSP-TOUT:N/A SPL-OVERHEAD:RAW-IP,ETH - Lan ------------------------------------------------------------------ STATE:LINKREADY ARP-CACHE-ITEMS:1
Tip | |
---|---|
Interesting chapters: |