New Member
Posts: 26
Registered: ‎11-18-2012
Accepted Solution

ERL/UniFi

Hello all.  First, I'd like to appologize, my CLI skills are lacking and the IN-OUT-LOCAL thing twists my mind into tiny little knots.

I have the basic SOHO config loaded and all looks good to the internet from both eth0 & eth1 and I can ping between the two.  The problem arises when I try to manage my AP's with the UniFi App.  The AP is plugged into eth1, the App is on a MBP pulling an ip from eth0.  The App never finds the AP.  If I attach the AP to the eth0 network, it pops up in seconds as manageable.  

Eth0/1 IN & LOCAL are both set as default Accept in the firewall, which by my limited understanding says they should talk to one another.  I'm thinking I'm missing some firewall setting and would appreciated any suggestions.

 

thanks

alex


Accepted Solutions
Previous Employee
Posts: 10,504
Registered: ‎06-09-2011
Kudos: 3141
Solutions: 945
Contributions: 16

Re: ERL/UniFi

I think if you're AP is on a different subnet, then you need use dhcp option 43.  We plan to make this easier to configure in the future, but for now could you try adding the following from the CLI.  Note: replace 1.1.1.1 with the IP address of the UniFi controller.

configure
set service dhcp-server global-parameters "option space ubnt;" set service dhcp-server global-parameters "option ubnt.unifi-address code 1 = ip-address;" set service dhcp-server global-parameters "class "ubnt" {" set service dhcp-server global-parameters " match if subnstring (option vendor-class-identifier, 0, 4) = "ubnt";" set service dhcp-server global-parameters " option vendor-class-identifier "ubnt";" set service dhcp-server global-parameters " vendor-option-space ubnt;" set service dhcp-server global-parameters "}" set service dhcp-server shared-network-name wired-eth0 subnet 192.168.1.0/24 subnet-parameters "option ubnt.unifi-address 1.1.1.1;"
commit
save
exit

 

 

EdgeMAX Router Software Development

View solution in original post


All Replies
Previous Employee
Posts: 10,504
Registered: ‎06-09-2011
Kudos: 3141
Solutions: 945
Contributions: 16

Re: ERL/UniFi

I think if you're AP is on a different subnet, then you need use dhcp option 43.  We plan to make this easier to configure in the future, but for now could you try adding the following from the CLI.  Note: replace 1.1.1.1 with the IP address of the UniFi controller.

configure
set service dhcp-server global-parameters "option space ubnt;" set service dhcp-server global-parameters "option ubnt.unifi-address code 1 = ip-address;" set service dhcp-server global-parameters "class "ubnt" {" set service dhcp-server global-parameters " match if subnstring (option vendor-class-identifier, 0, 4) = "ubnt";" set service dhcp-server global-parameters " option vendor-class-identifier "ubnt";" set service dhcp-server global-parameters " vendor-option-space ubnt;" set service dhcp-server global-parameters "}" set service dhcp-server shared-network-name wired-eth0 subnet 192.168.1.0/24 subnet-parameters "option ubnt.unifi-address 1.1.1.1;"
commit
save
exit

 

 

EdgeMAX Router Software Development
Previous Employee
Posts: 10,504
Registered: ‎06-09-2011
Kudos: 3141
Solutions: 945
Contributions: 16

Re: ERL/UniFi

[ Edited ]

Actually now that I think about it, if you're AP is off eth1 then we need to add that option to the dhcp-server for eth1 instead of eth2.

set service dhcp-server shared-network-name wireless-eth1 subnet 192.168.2.0/24 subnet-parameters "option ubnt.unifi-address 1.1.1.1;"

 

EdgeMAX Router Software Development
New Member
Posts: 26
Registered: ‎11-18-2012

Re: ERL/UniFi

I appreciate the reply, Stig.  Am I to understand that there is currently no way to accomplish this through the GUI?  I will try your suggestion and get back to you.

 

thanks again

 

alex

Previous Employee
Posts: 10,504
Registered: ‎06-09-2011
Kudos: 3141
Solutions: 945
Contributions: 16

Re: ERL/UniFi


@Mtnmann wrote:

I appreciate the reply, Stig.  Am I to understand that there is currently no way to accomplish this through the GUI?  I will try your suggestion and get back to you.

 

thanks again

 

alex


Yes, currently it can not be done from the GUI.  What we plan to do is add a "UniFi Controller" field to the GUI for dhcp-server which would then add all the right bits to the dhcp-server configuration file.  The UniFi wiki covers UniFi Layer 3 management , but we'd like to make it much easier than that.

EdgeMAX Router Software Development
New Member
Posts: 26
Registered: ‎11-18-2012

Re: ERL/UniFi

ubnt@ubnt:~$ configure
[edit]
ubnt@ubnt# set srvice dhcp-server global-parameters "option space ubnt;"
The specified configuration node is not valid
Set failed
[edit]
ubnt@ubnt# set service dhcp-server global-parameters "option space ubnt;"
[edit]
ubnt@ubnt# set service dhcp-server global-parameters "option ubnt.unifi-address
code 1 = ip-address;"
[edit]
ubnt@ubnt# set service dhcp-server global-parameters "class "ubnt";{"
[edit]
ubnt@ubnt# set service dhcp-server global-parameters "match if subnstring (optio
n vendor-class-identifier, 0, 4) = "ubnt";"
[edit]
ubnt@ubnt# set service dhcp-server global-parameters "option vendor-class-identi
fier "ubnt";"
[edit]
ubnt@ubnt# set service dhcp-server global-parameters "vendor-option-space ubnt;"
[edit]
ubnt@ubnt# set service dhcp-server global-parameters "}"
[edit]
ubnt@ubnt# set service dhcp-server shared-network-name wireless-eth1 subnet 192.
168.2.0/24 subnet-parameters "option ubnt.unifi-address 192.168.1.110;"
[edit]
ubnt@ubnt# commit
[ service dhcp-server ]
Stopping DHCP server daemon...
Starting DHCP server daemon...
[edit]
ubnt@ubnt# save
Saving configuration to '/config/config.boot'...
Done
[edit]
ubnt@ubnt# exit
exit
ubnt@ubnt:~$

 Above is what I typed into the GUI CLI interface.  Hopefully I guessed correctly on some of the less than clear code (quotes were garbled, etc...) Code is not my thing, but I can copy and paste with the best of them.  Other than running the Unifi Discover Utility, any suggestions on how to test?  So far it doesn't look like it had any positive effect.

 

thanks

alex

Previous Employee
Posts: 10,504
Registered: ‎06-09-2011
Kudos: 3141
Solutions: 945
Contributions: 16

Re: ERL/UniFi

Actually I wanted you to leave the " in the commands since that is the escape code for double quotes.  Also note that your 1st command failed to set since you had "srvice" instead of "service".

EdgeMAX Router Software Development
Previous Employee
Posts: 10,504
Registered: ‎06-09-2011
Kudos: 3141
Solutions: 945
Contributions: 16

Re: ERL/UniFi

Before you try re-entering those commands, let's first remove the old ones with:

configure
delete service dhcp-server global-parameters
commit
save
exit

 

EdgeMAX Router Software Development
New Member
Posts: 26
Registered: ‎11-18-2012

Re: ERL/UniFi

[ Edited ]

Second try.  Let me know how it looks.

 

EDIT:  Am I getting the last Set Service correct?

 

ubnt@ubnt:~$ configure                                                          
[edit]                                                                          
ubnt@ubnt# delete service dhcp-server global-parameters                         
[edit]                                                                          
ubnt@ubnt# commit                                                               
[ service dhcp-server ]                                                         
Stopping DHCP server daemon...                                                  
Starting DHCP server daemon...                                                  
                                                                                
[edit]                                                                          
ubnt@ubnt# save                                                                 
Saving configuration to '/config/config.boot'...                                
Done                                                                            
[edit]                                                                          
ubnt@ubnt# exit                                                                 
exit                                                                            
ubnt@ubnt:~$ configure                                                          
[edit]                                                                          
ubnt@ubnt# set service dhcp-server global-parameters "option space ubnt;"       
[edit]                                                                          
ubnt@ubnt# set service dhcp-server global-parameters "option ubnt.unifi-address 
code 1 = ip-address;"                                                           
[edit]                                                                          
ubnt@ubnt# set service dhcp-server global-parameters "class "ubnt" {" 
[edit]
ubnt@ubnt# set service dhcp-server global-parameters "    match if subnstring (o
ption vendor-class-identifier, 0, 4) = "ubnt";"                       
[edit]                                                                          
ubnt@ubnt# set service dhcp-server global-parameters "    option vendor-class-id
entifier "ubnt";"
[edit]                                                                          
ubnt@ubnt# set service dhcp-server global-parameters "    vendor-option-space ub
nt;"
[edit]                                                                          
ubnt@ubnt# set service dhcp-server global-parameters "}"                        
[edit]
ubnt@ubnt# set service dhcp-server shared-network-name wireless-eth1 subnet 192.
168.2.0/24 subnet-parameters "option ubnt.unifi-address 192.168.1.110;"         
The specified configuration node already exists                                 
[edit]                                                                          
ubnt@ubnt# commit                                                               
[ service dhcp-server ]                                                         
Stopping DHCP server daemon...                                                  
Starting DHCP server daemon...                                                  
                                                                                
[edit]                                                                          
ubnt@ubnt# save                                                                 
Saving configuration to '/config/config.boot'...                                
Done                                                                            
[edit]                                                                          
ubnt@ubnt# exit                                                                 
exit

 

Previous Employee
Posts: 10,504
Registered: ‎06-09-2011
Kudos: 3141
Solutions: 945
Contributions: 16

Re: ERL/UniFi

It looks ok, but the real question is does it work?  I'm guessing not since you didn't mention it.

 

If there were any syntax errors then the daemon will die. So can you verify that the dhcpd is running:

ubnt@ubnt# ps aux | grep dhcpd 
ubnt      1451  0.0  0.1   2364   492 ttyS0    S+   22:39   0:00 /bin/busybox grep dhcpd
root      2009  0.0  0.5   4648  2840 ?        S    May09   0:00 /usr/sbin/dhcpd3 -f -pf /var/run/dhcpd-unused.pid -cf /opt/vyatta/etc/dhcpd.conf -lf /var/run/dhcpd.leases

 And to see the configuration:

configure
show service dhcp-server
exit

 

EdgeMAX Router Software Development
New Member
Posts: 26
Registered: ‎11-18-2012

Re: ERL/UniFi

Here's the output:

 

ubnt@ubnt:~$ ps aux | grep dhcpd                                                
root      8284  0.0  0.5   4652  2848 ?        S    15:29   0:00 /usr/sbin/dhcpd3 -f -pf /var/run/dhcp
d-unused.pid -cf /opt/vyatta/etc/dhcpd.conf -lf /var/run/dhcpd.leases                                 
ubnt      8690  0.0  0.1   2364   596 pts/0    S+   15:46   0:00 /bin/busybox grep dhcpd              
ubnt@ubnt:~$ configure                                                                                
[edit]                                                                                                
ubnt@ubnt# show service dhcp-server                                                                   
 disabled false                                                                                       
 global-parameters "option space ubnt;"                                                               
 global-parameters "option ubnt.unifi-address code 1 = ip-address;"                                   
 global-parameters "class "ubnt" {"                                                         
 global-parameters "    match if subnstring (option vendor-class-identifier, 0, 4) = "ubnt";
"                                                                                                     
 global-parameters "    option vendor-class-identifier "ubnt";"                             
 global-parameters "    vendor-option-space ubnt;"                                                    
 global-parameters "}"                                                                                
 shared-network-name wired-eth0 {                                                                     
     authoritative enable                                                                             
     description "Wired Network - Eth0"                                                               
     subnet 192.168.1.0/24 {                                                                          
         default-router 192.168.1.1                                                                   
         dns-server 192.168.1.1                                                                       
         lease 86400                                                                                  
         ntp-server 192.168.1.1                                                                       
         start 192.168.1.10 {                                                                         
             stop 192.168.1.100                                                                       
         }                                                                                            
         time-server 192.168.1.1                                                                      
     }                                                                                                
 }                                                                                                    
:      

 

Previous Employee
Posts: 10,504
Registered: ‎06-09-2011
Kudos: 3141
Solutions: 945
Contributions: 16

Re: ERL/UniFi

I thought you said the AP was off eth1, but there's no dhcp-server section for eth1.

EdgeMAX Router Software Development
New Member
Posts: 26
Registered: ‎11-18-2012

Re: ERL/UniFi

Don't know what to say.  I ran the Show Service command again and got the same output.  That being said, the GUI is showing two DHCP servers; wired-eth0 & wireless-eth1.  Both have leases...

Your magic may have worked though.  The Unifi App was able to find the AP and connect to it.  I'm going to play with it a bit and see how it's working.  Thanks so far.

 

alex

Previous Employee
Posts: 10,504
Registered: ‎06-09-2011
Kudos: 3141
Solutions: 945
Contributions: 16

Re: ERL/UniFi

[ Edited ]

Oh, I see what happen - the colon is the pager.  After the page filled up, it paused waiting for you to hit the space bar to continue.  Try the command again with the following command which will disable the pager:

configure
show service dhcp-server | no-more
exit

 

EDIT: ok, if it's working that I don't need to see the output.

EdgeMAX Router Software Development
Highlighted
New Member
Posts: 26
Registered: ‎11-18-2012

Re: ERL/UniFi

Thanks again Stig.  It is working as far as I can tell.  Thanks for putting up with my CLI ignorance.  For completeness's sake, the Show Service cmd gave this:

 

Welcome to EdgeMAX
ubnt@ubnt:~$ configure
[edit]
ubnt@ubnt# show service dhcp-server
 disabled false
 global-parameters "option space ubnt;"
 global-parameters "option ubnt.unifi-address code 1 = ip-address;"
 global-parameters "class "ubnt" {"
 global-parameters "    match if subnstring (option vendor-class-identifier, 0, 4) = "ubnt";
"
 global-parameters "    option vendor-class-identifier "ubnt";"
 global-parameters "    vendor-option-space ubnt;"
 global-parameters "}"
 shared-network-name wired-eth0 {
     authoritative enable
     description "Wired Network - Eth0"
     subnet 192.168.1.0/24 {                                                                          
         default-router 192.168.1.1                                                                   
         dns-server 192.168.1.1                                                                       
         lease 86400                                                                                  
         ntp-server 192.168.1.1                                                                       
         start 192.168.1.10 {                                                                         
             stop 192.168.1.100                                                                       
         }                                                                                            
         time-server 192.168.1.1                                                                      
     }                                                                                                
 }                                                                                                    
 shared-network-name wireless-eth1 {
     authoritative enable                                                                             
     description "Wireless Network - Eth1"                                                            
     subnet 192.168.2.0/24 {                                                                          
         default-router 192.168.2.1                                                                   
         dns-server 192.168.2.1                                                                       
         lease 86400                                                                                  
         ntp-server 192.168.2.1                                                                       
         start 192.168.2.10 {                                                                         
             stop 192.168.2.100                                                                       
         }                                                                                            
         subnet-parameters "option ubnt.unifi-address 192.168.1.110;"                                 
         time-server 192.168.2.1                                                                      
     }                                                                                                
 }                                                                                                    
[edit]
ubnt@ubnt#                                                                                            
    

 And it did seem to do what I had hoped.

 

thanks again.

 

alex