Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    DHCP Leases, Interfaces, & ARP Table Tab Vendor MAC Change w/ 5-15 Snap

    Scheduled Pinned Locked Moved 2.0-RC Snapshot Feedback and Problems - RETIRED
    29 Posts 4 Posters 7.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      LostInIgnorance
      last edited by

      Did anyone else have the MAC addresses change to manufacturer names with the newest snap?
      2.0-RC2 (i386) built on Sun May 15 03:21:07 EDT 2011

      I know the first question is, did I install the "MAC to vendor" package, but I have not installed it.  I would not mind having two columns, one with the MAC, and one with the vendor (since I have the widescreen package installed).

      EDIT: NOTE: Install NMAP package before edit

      1 Reply Last reply Reply Quote 0
      • N
        Nachtfalke
        last edited by

        Hi,

        I do not have this, bu I got this line above the lease table:

        Warning: file(/usr/local/share/nmap/nmap-mac-prefixes): failed to open stream: No such file or directory in /etc/inc/pfsense-utils.inc on line 2194 
        

        I have this on two machines with snapshot:
        2.0-RC2 (amd64) built on Sun May 15 04:20:20 EDT 2011

        1 Reply Last reply Reply Quote 0
        • L
          LostInIgnorance
          last edited by

          Yeah, looks like they changed it from:

                          if ($data['online'] != "online") {
                                  echo "{$fspans}[{$data['mac']}](\"services_wol.php?if={$data['if']}&mac={$data['mac']}\" "\"""){$fspane} \n";
                          } else {
                          	echo "{$fspans}{$data['mac']}{$fspane} \n";
                          }
          
          

          To:

          		$mac=$data['mac']; 
          		$mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
                          if ($data['online'] != "online") {
          			if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
          	                        echo "{$fspans}[{$mac_man[$mac_hi]}](\"services_wol.php?if={$data['if']}&mac=$mac\" "\"""){$fspane} \n";
          			}else{	
                                  	echo "{$fspans}[{$data['mac']}](\"services_wol.php?if={$data['if']}&mac={$data['mac']}\" "\"""){$fspane} \n";
          			}
                          }else{
          			if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
          	                	echo "{$fspans}{$mac_man[$mac_hi]}{$fspane} \n";
          	                }else{
                          		echo "{$fspans}{$data['mac']}{$fspane} \n";
          			}
                          }
          
          
          1 Reply Last reply Reply Quote 0
          • L
            LostInIgnorance
            last edited by

            Now what I would like to know is how I can display both sets of info.  The MAC in one column and the Vendor in another right next to each other.  If the vendor isn't in the database, the vendor column would just be blank.

            1 Reply Last reply Reply Quote 0
            • L
              LostInIgnorance
              last edited by

              GOT IT!!  It is now displaying both sets of information correctly. :D
              NOTE: Install the nmap package
              (I left the beginnings and ends of some of the other code around it so it makes it easier to replace)

              Edit /usr/local/www/status_dhcp_leases.php

              		echo "\n";
                              echo "{$fspans}{$data['ip']}{$fspane} \n";
                              if ($data['online'] != "online") {
                                      echo "{$fspans}[{$data['mac']}](\"services_wol.php?if={$data['if']}&mac={$data['mac']}\" "\"""){$fspane} \n";
                              } else {
                              	echo "{$fspans}{$data['mac']}{$fspane} \n";
                              }
              		$mac=$data['mac']; 
              		$mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
                              if ($data['online'] != "online") {
              			if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
              	                        echo "{$fspans}{$mac_man[$mac_hi]}{$fspane} \n";
              			}else{	
                                      	echo " \n";
              			}
                              }else{
              			if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
              	                	echo "{$fspans}{$mac_man[$mac_hi]}{$fspane} \n";
              	                }else{
                              		echo " \n";
              			}
                              }
                              echo "{$fspans}"  . htmlentities($data['hostname']) . "{$fspane} \n";
              				if ($data['type'] != "static") {
              					echo "{$fspans}" . adjust_gmt($data['start']) . "{$fspane} \n";
              					echo "{$fspans}" . adjust_gmt($data['end']) . "{$fspane} \n";
              				} else {
              					echo "{$fspans} n/a {$fspane} \n";
              					echo "{$fspans} n/a {$fspane} \n";
              				}
              
              

              Now I just have to figure out how/where to edit the MAC database  :-\

              DHCP.jpg
              DHCP.jpg_thumb

              1 Reply Last reply Reply Quote 0
              • L
                LostInIgnorance
                last edited by

                Edit /usr/local/www/status_interfaces.php

                
                						echo "  |  ";
                			$mac=$ifinfo['macaddr']; 
                			$mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
                			if(isset($mac_man[$mac_hi])){ print "" . htmlspecialchars($mac_man[$mac_hi]); print ""; }
                			      else {print htmlspecialchars($mac);}
                			?>
                
                

                Interfaces.jpg
                Interfaces.jpg_thumb

                1 Reply Last reply Reply Quote 0
                • L
                  LostInIgnorance
                  last edited by

                  Edit /usr/local/www/diag_arp.php

                  
                  					  |					  |					  |					  |					  |													
                  						  |						 
                  												echo "  |  ";
                  						$mac=$entry['mac']; 
                  						$mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
                  						if(isset($mac_man[$mac_hi])){ print "{$mac_man[$mac_hi]}"; }
                  						else{ print " "; }
                  						?>
                  						 | 
                  														echo str_replace("Z_ ", "", $entry['dnsresolve']);
                  							?>
                  						 |						  |												
                  
                  		 |	
                  
                  

                  ARP.jpg_thumb
                  ARP.jpg

                  1 Reply Last reply Reply Quote 0
                  • C
                    Cino
                    last edited by

                    nice work! I hope one of the developers can add this to the mainline code.

                    1 Reply Last reply Reply Quote 0
                    • L
                      LostInIgnorance
                      last edited by

                      The only problem that arises is that the changes will not fit on the normal screen size.  They would have to add it into the widescreen package.

                      1 Reply Last reply Reply Quote 0
                      • L
                        LostInIgnorance
                        last edited by

                        You can also change it like so to add a column instead of being in the same column with the little pipe divider.

                        Edit /usr/local/www/diag_arp.php

                        
                        					  |					  |					  |					  |					  |					  |													
                        						  |						  |						 
                        												$mac=$entry['mac']; 
                        						$mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
                        						if(isset($mac_man[$mac_hi])){ print "{$mac_man[$mac_hi]}"; }
                        						else{ print " "; }
                        						?>
                        						 | 
                        														echo str_replace("Z_ ", "", $entry['dnsresolve']);
                        							?>
                        						 |						  |												
                        
                        		 |	
                        
                        

                        ARP.jpg
                        ARP.jpg_thumb

                        1 Reply Last reply Reply Quote 0
                        • C
                          Cino
                          last edited by

                          I added the code and was able to see it fine without the widescreen package, 1024x768. Fits perfectly!

                          1 Reply Last reply Reply Quote 0
                          • N
                            Nachtfalke
                            last edited by

                            I edited the file, copied it to the directory but couldn't see anything.

                            Should I have to restart the webserver - if yes how could I do that ?
                            The Layout with mac AND vendor together is very interesting for me!

                            1 Reply Last reply Reply Quote 0
                            • C
                              Cino
                              last edited by

                              do you have the nmap package installed? You need that for it to display the vendor names

                              1 Reply Last reply Reply Quote 0
                              • N
                                Nachtfalke
                                last edited by

                                Hi,

                                yes I did.
                                Installed the nmpa package
                                downloades the diag_arp.php file
                                edited the file Notepadd++
                                uploaded it
                                copied it from /tmp/ to /usr/local/www/

                                it now only shows me the complete vendor name without any mac.

                                Strange - it should work…I just did copy & paste...

                                1 Reply Last reply Reply Quote 0
                                • L
                                  LostInIgnorance
                                  last edited by

                                  Did you replace the section as outlined above?  I did leave some of the other lines in there to show where it goes.

                                  Here, to make it easier, I added an attachment of my ARP file.

                                  EDIT: Decided to just upload all three.  Just make sure to get rid of the .txt at the end.

                                  diag_arp.php.txt
                                  status_dhcp_leases.php.txt
                                  status_interfaces.php.txt

                                  1 Reply Last reply Reply Quote 0
                                  • N
                                    Nachtfalke
                                    last edited by

                                    I didn't get it work … :(

                                    I deleted /usr/local/www/diag_arp.php and copied there thge new on. I checked it with time and date.
                                    I restarted the webcopnfigurator from the console but with no success.

                                    I have iperf, nmap and openvpn export utility installed.
                                    I am using this snapshot:
                                    2.0-RC2 (amd64) built on Sun May 15 04:20:20 EDT 2011

                                    1 Reply Last reply Reply Quote 0
                                    • N
                                      Nachtfalke
                                      last edited by

                                      I am so stupid…
                                      Your last post did it.

                                      Of course I have to edit all three .php files and not only just one....next time I will read the thread a second time ;-)

                                      Thank you very much for your patience!!
                                      Now it looks very well!

                                      1 Reply Last reply Reply Quote 0
                                      • L
                                        LostInIgnorance
                                        last edited by

                                        Can't say I haven't done that before to myself.  :P

                                        Glad you like it  :D

                                        1 Reply Last reply Reply Quote 0
                                        • jimpJ
                                          jimp Rebel Alliance Developer Netgate
                                          last edited by

                                          I don't like that it replaces the MAC column, often I want/need the MAC and not the vendor, but I also don't want another column.

                                          I prefer the more subtle approach of putting the vendor in a tooltip when you hover over the MAC, or on a second line below the MAC in a smaller font.

                                          Basically either flip the parameters in diag_arp.php:

                                          						if(isset($mac_man[$mac_hi])){ print "{$mac}"; }
                                          

                                          Or replace these two lines:

                                          						if(isset($mac_man[$mac_hi])){ print "{$mac_man[$mac_hi]}"; }
                                          						else{ print $mac; }
                                          

                                          with

                                          						print $mac;
                                          						if(isset($mac_man[$mac_hi])){ print "
                                          _{$mac_man[$mac_hi]}_"; }
                                          

                                          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                                          Need help fast? Netgate Global Support!

                                          Do not Chat/PM for help!

                                          1 Reply Last reply Reply Quote 0
                                          • L
                                            LostInIgnorance
                                            last edited by

                                            I'll use that on a customer since he has a small screen and we don't have the widescreen installed on his.  I think he'll like that change a lot.  Thanks JimP!!

                                            As for me personally, I have way too much white space with the widescreen and would like to fill it up with something useful instead of having 4 columns of info and the rest is white space between.  Looks bad on the interfaces tab with 2/3 of the screen not being used.  Looking into modifying that next.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.