Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 112

Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 112

Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 116
11 月 | 2016 | FreeSandal

飛行派工作日誌《六》

假使將問題輕輕放過,久而久之必模模糊糊,不知來去矣!!於是乎考之以樹莓派論壇,聽聽人們的經驗談,看看解決嘗試的方向︰

Configuring Network using dhcpcd

by Milliways » Sat May 30, 2015 2:57 am
I have installed the new `raspberrypi-net-mods` using `dhcpcd`. This works, but I am trying to understand why and how.
I have read the `dhcpcd` and `interfaces` `man` pages but these do not seem to apply to the actual interface.The `/etc/network/interfaces` used to contain `iface eth0 inet dhcp` which has been replaced by `iface eth0 inet manual`Where does the IP address come from? This seems to allocate the same IP reservation from my router.(I am trying to work out a configuration which will let my Pi work normally with dhcp on my home network, but allocate a `static` address so I can connect to the Pi over Ethernet (or ad-hoc WiFi) to my Mac in a remote environment with no router or internet access.)

……

by rpdom » Sun May 31, 2015 4:59 am
morgon wrote:Maybe I don’t understand your posting (and I may have one beer too many)

How many is too many? ;)

The new dhcpd seems to ignore the normal /etc/network/interfaces settings and just do its own thing. I might have a look at the reasoning for this and how to configure it one day, but for now I’m sticking with the old one that has worked since forever.

(I think the new one may need some GUI stuff to configure it? I run headless, so no idea)

───

Set Static IP address but also getting Dynamic

by kez » Sat Oct 31, 2015 9:59 am

This problem was plaguing me for ages. dhcpcd5 simply seems to ignore the interfaces file so you have to set exclusions in the dhcpcd.conf file. Really quick and easy to do.

Try adding the line:

denyinterfaces eth0

to /etc/dhcpcd.conf (change eth0 as required).

No need to make any extra changes in /etc/network/interfaces or uninstall anything.

man dhcpcd.conf for more info.

Sorry if I missed someone else posting this already or within a link to another post.

Kez

───

 

縱使有時某甲有用之法,某乙用之無效??至少可觀錯綜複雜脈絡也。因此在仔細閱讀 dhcpcd5 文件後︰

DHCPCD.CONF(5)              BSD File Formats Manual             DHCPCD.CONF(5)

NAME
     dhcpcd.conf — dhcpcd configuration file

DESCRIPTION
     Although dhcpcd can do everything from the command line, there are cases
     where it's just easier to do it once in a configuration file.  Most of
     the options found in dhcpcd(8) can be used here.  The first word on the
     line is the option and the rest of the line is the value.  Leading and
     trailing whitespace for the option and value are trimmed.  You can escape
     characters in the value using the \ character.

     Blank lines and lines starting with # are ignored.

     Here's a list of available options:

     allowinterfaces pattern
             When discovering interfaces, the interface name must match
             pattern which is a space or comma separated list of patterns
             passed to fnmatch(3).  If the same interface is matched in
             denyinterfaces then it is still denied.

 Manual page dhcpcd.conf(5) line 1 (press h for help or q to quit)

 

決定只用 dhcpcd5 程式來管理網路裝置︰

cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and ‘man dhcpcd.conf’

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

# allow-hotplug wlan1
# iface wlan1 inet manual
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

 

cat /etc/dhcpcd.conf
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by default.
#option interface_mtu

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname

interface wlan1
static ip_address=192.168.8.1/24
static routers=192.168.8.1
static domain_name_servers=192.168.8.1

 

似乎一切正常哩!!

pi@raspberrypi:~ ifconfig  eth0      Link encap:Ethernet  HWaddr b8:27:eb:8a:12:64             inet addr:5.168.168.19  Bcast:5.168.168.255  Mask:255.255.255.0           inet6 addr: fe80::629a:af0a:4cf8:32ee/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:68235 errors:0 dropped:1 overruns:0 frame:0           TX packets:4257 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:3208585 (3.0 MiB)  TX bytes:924909 (903.2 KiB)  lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:65536  Metric:1           RX packets:13934 errors:0 dropped:0 overruns:0 frame:0           TX packets:13934 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1            RX bytes:1627106 (1.5 MiB)  TX bytes:1627106 (1.5 MiB)  wlan0     Link encap:Ethernet  HWaddr b8:27:eb:df:47:31             inet addr:192.168.8.124  Bcast:192.168.8.255  Mask:255.255.255.0           inet6 addr: fe80::593e:a20:e109:ff10/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:211713 errors:0 dropped:251 overruns:0 frame:0           TX packets:74349 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:45854983 (43.7 MiB)  TX bytes:9146774 (8.7 MiB)  wlan1     Link encap:Ethernet  HWaddr 7c:dd:90:7a:62:5a             inet addr:192.168.8.1  Bcast:192.168.8.255  Mask:255.255.255.0           inet6 addr: fe80::9622:163b:b34c:5446/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:145426 errors:0 dropped:0 overruns:0 frame:0           TX packets:148126 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:14265502 (13.6 MiB)  TX bytes:17429653 (16.6 MiB)  pi@raspberrypi:~ 

 

誰知其他電腦卻連不上耶??

 

 

 

 

 

 

 

 

 

飛行派工作日誌《五》

世事經常變動不居!實務工作者總是煩惱不斷?本想著用樹莓派作 AP 不過小菜一碟,早已知知的哩︰

Pi-Point – turn your Raspberry Pi into a wireless access point

I was shown Pi Point before the holidays, but thought it was best to wait until now to spring it on you, because so many of you have got Pis for Christmas and are looking for projects to use them in.

Guy Eastwood has documentation and an SD card image which will allow you to turn your Pi into a wireless access point. With a bit of imagination applied, you can find a million uses for a tiny, waterproofable (think Tupperware and epoxy), cheap access point; of course, you can just use it to extend your home network, but the possibilities get really interesting if you think outside the box. You can build a guest network, firewalled off from your local network. You can learn about network hardening. With the addition of a home-made cantenna, you could set up a line of Pis as relays to get WiFi down to the shed in your allotment, or point a signal at your treehouse. If you’re an altruist, you can provide your local bus stop with free WiFi.

Let us know what you end up doing with Pi-Point. We’d love to hear what you come up with!

……

Turn your Raspberry Pi into a Wireless Access Point

_MG_8219b.jpg

Welcome and thank you for dropping by. If you’re a Raspberry Pi owner and are curious about some of the  things you can do with it then this is where you can learn how to turn it into a WiFi Access Point.
There’s all sorts of reasons why you may want to do this…

  • Extend your existing WiFi network
  • Learn more about wireless networking
  • Create a free Access Point
  • Build a honeytrap to learn about network-hardening
  • Learn about sniffing packets
  • Provide guest wireless access firewalled off/through your main network
  • Closed wifi monitoring station, e.g. temperature sensor, weather recording
  • Create a Raspberry Pi WiFi HotSpot

Given that you have a Pi, though one of the main reasons is likely to be ‘because you can’ !

To get started, follow the Documentation link above to be guided through setting up a Pi-Point from operating system install to fully working, I hope you find this useful!

– Guy Eastwood

───

 

怎曉按表操課,依樣葫蘆︰

pi@raspberrypi:~ sudo nano /etc/hostapd/hostapd.conf pi@raspberrypi:~ cat /etc/hostapd/hostapd.conf
interface=wlan1
driver=nl80211
ssid=freesandal
hw_mode=g
channel=10
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=freesandal
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

 

# If you want dnsmasq to listen for DHCP and DNS requests only on
# specified interfaces (and the loopback) give the name of the
# interface (eg eth0) here.
# Repeat the line for more than one interface.
interface=wlan1

# This is an example of a DHCP range where the netmask is given. This
# is needed for networks we reach the dnsmasq DHCP server via a relay
# agent. If you don't know what a DHCP relay agent is, you probably
# don't need to worry about this.
dhcp-range=192.168.8.50,192.168.8.150,255.255.255.0,12h

# Send an empty WPAD option. This may be REQUIRED to get windows 7 to behave.
dhcp-option=252,"\n"

 

pi@raspberrypi:~ sudo nano /etc/network/interfaces pi@raspberrypi:~ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

# allow-hotplug wlan1
# iface wlan1 inet manual
#     wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

iface wlan1 inet static
address 192.168.8.1
netmask 255.255.255.0
pi@raspberrypi:~ </pre>   <pre class="lang:default decode:true ">pi@raspberrypi:~ sudo nano /etc/dnsmasq.conf 
pi@raspberrypi:~ sudo nano /etc/init.d/pipoint pi@raspberrypi:~ cat /etc/init.d/pipoint
#!/bin/sh
# Configure Wifi Access Point.
#
### BEGIN INIT INFO
# Provides: WifiAP
# Required-Start: remote_fssyslog time # Required-Stop:remote_fs syslogtime
# Should-Start: networknamed slapd autofs ypbind nscd nslcd
# Should-Stop: networknamed slapd autofs ypbind nscd nslcd
# Default-Start: 2
# Default-Stop:
# Short-Description: Wifi Access Point configuration
# Description: Sets forwarding, starts hostap, enables NAT in iptables
### END INIT INFO 

# turn on forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward

# enable NAT
iptables -t nat -A POSTROUTING -j MASQUERADE

# start the access point
hostapd -B /etc/hostapd/hostapd.conf

pi@raspberrypi:~ sudo chmod +x /etc/init.d/pipoint pi@raspberrypi:~ sudo update-rc.d pipoint start 99 2
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
pi@raspberrypi:~ </pre>    <span style="color: #003300;">竟然昨是今非的耶??</span> <pre class="lang:default decode:true">pi@raspberrypi:~ ifconfig 
eth0      Link encap:Ethernet  HWaddr b8:27:eb:8a:12:64  
          inet addr:5.168.168.19  Bcast:5.168.168.255  Mask:255.255.255.0
          inet6 addr: fe80::629a:af0a:4cf8:32ee/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:113 errors:0 dropped:1 overruns:0 frame:0
          TX packets:134 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:17998 (17.5 KiB)  TX bytes:26380 (25.7 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:116 errors:0 dropped:0 overruns:0 frame:0
          TX packets:116 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:23001 (22.4 KiB)  TX bytes:23001 (22.4 KiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:df:47:31  
          inet6 addr: fe80::593e:a20:e109:ff10/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:195 errors:0 dropped:194 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:65281 (63.7 KiB)  TX bytes:261 (261.0 B)

# 那ㄟ啊ㄋㄟ??
wlan1     Link encap:Ethernet  HWaddr 7c:dd:90:7a:62:5a  
          inet addr:169.254.157.11  Bcast:169.254.255.255  Mask:255.255.0.0
          inet6 addr: fe80::9622:163b:b34c:5446/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:135 (135.0 B)  TX bytes:12186 (11.9 KiB)

pi@raspberrypi:~ </pre>    <span style="color: #003300;">雖說可以補過︰</span> <pre class="lang:default decode:true">pi@raspberrypi:~ cat /etc/rc.local 
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=(hostname -I) || true if [ "_IP" ]; then
  printf "My IP address is %s\n" "_IP" fi  ifconfig wlan1 192.168.8.1  exit 0 pi@raspberrypi:~

 

pi@raspberrypi:~ ifconfig  eth0      Link encap:Ethernet  HWaddr b8:27:eb:8a:12:64             inet addr:5.168.168.19  Bcast:5.168.168.255  Mask:255.255.255.0           inet6 addr: fe80::629a:af0a:4cf8:32ee/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:432 errors:0 dropped:1 overruns:0 frame:0           TX packets:305 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:35650 (34.8 KiB)  TX bytes:43077 (42.0 KiB)  lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:65536  Metric:1           RX packets:281 errors:0 dropped:0 overruns:0 frame:0           TX packets:281 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1            RX bytes:36341 (35.4 KiB)  TX bytes:36341 (35.4 KiB)  wlan0     Link encap:Ethernet  HWaddr b8:27:eb:df:47:31             inet addr:192.168.8.124  Bcast:192.168.8.255  Mask:255.255.255.0           inet6 addr: fe80::593e:a20:e109:ff10/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:536 errors:0 dropped:241 overruns:0 frame:0           TX packets:31 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:148384 (144.9 KiB)  TX bytes:6964 (6.8 KiB)  # Why? Why? Why? OK !!  wlan1     Link encap:Ethernet  HWaddr 7c:dd:90:7a:62:5a             inet addr:192.168.8.1  Bcast:192.168.8.255  Mask:255.255.255.0           inet6 addr: fe80::9622:163b:b34c:5446/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:31 errors:0 dropped:0 overruns:0 frame:0           TX packets:134 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:6228 (6.0 KiB)  TX bytes:27465 (26.8 KiB)  pi@raspberrypi:~ 

 

又得探究乎!!

 

 

 

 

 

 

 

 

飛行派工作日誌《四》

不知是否因為樹莓派 3B 內建 WiFi 有電源管理問題,或是由於沒有 monitor mode 不能跑 horst 頻譜分析。所以飛行派 BOM 裡有 WiFi  AP dongle 這一項?既然將選用 WiFi USB dongle 來作 Access Point ,當然最好是具有 IEEE802.11  相容模式。如是安裝 hostapd 也比較容易,無須顧慮驅動程式 device driver 的問題!

hostapd: IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator

hostapd is a user space daemon for access point and authentication servers. It implements IEEE 802.11 access point management, IEEE 802.1X/WPA/WPA2/EAP Authenticators, RADIUS client, EAP server, and RADIUS authentication server. The current version supports Linux (Host AP, madwifi, mac80211-based drivers) and FreeBSD (net80211).

hostapd is designed to be a “daemon” program that runs in the background and acts as the backend component controlling authentication. hostapd supports separate frontend programs and an example text-based frontend, hostapd_cli, is included with hostapd.

Supported WPA/IEEE 802.11i/EAP/IEEE 802.1X features

  • WPA-PSK (“WPA-Personal”)
  • WPA with EAP (with integrated EAP server or an external RADIUS backend authentication server) (“WPA-Enterprise”)
  • key management for CCMP, TKIP, WEP104, WEP40
  • WPA and full IEEE 802.11i/RSN/WPA2
  • RSN: PMKSA caching, pre-authentication
  • IEEE 802.11r
  • IEEE 802.11w
  • RADIUS accounting
  • RADIUS authentication server with EAP
  • Wi-Fi Protected Setup (WPS)

 

尚可想想其他的應用︰

MiracleCast – Wifi-Display/Miracast Implementation

The MiracleCast project provides software to connect external monitors to your system via Wi-Fi. It is compatible to the Wifi-Display specification also known as Miracast. MiracleCast implements the Display-Source as well as Display-Sink side.

The Display-Source side allows you to connect external displays to your system and stream local content to the device. A lot of effort is put into making this as easy as connecting external displays via HDMI.

On the other hand, the Display-Sink side allows you to create wifi-capable external displays yourself. You can use it on your embedded devices or even on full desktops to allow other systems to use your device as external display.

Requirements

The MiracleCast projects requires the following software to be installed:

  • systemd: A system management daemon. It is used for device-management (udev), dbus management (sd-bus) and service management. Systemd >= 221 will work out of the box. For earlier versions systemd must be compiled with –enable-kdbus, even though kdbus isn’t used, but only the independent, experimental sd-libraries. required: >=systemd-213
  • glib: A utility library. Used by the current DHCP implementation. Will be removed once sd-dns gains DHCP-server capabilities. required: ~=glib2-2.38 (might work with older releases, untested..)
  • check: Test-suite for C programs. Used for optional tests of the MiracleCast code base. optional: ~=check-0.9.11 (might work with older releases, untested..)
  • gstreamer: MiracleCast relay on gstreamer to show cast its output. You can test if all needed is installed launching res/test-viewer.sh
  • P2P Wi-Fi device Although widespread this days, there are some devices not compatible with Wi-Fi Direct (prior know as Wi-Fi P2P). Test yours with res/test-hardware-capabilities.sh
  • copy the dbus policy res/org.freedesktop.miracle.conf to /etc/dbus-1/system.d/

 

Wireless Display Software For Linux OS (WDS)

WDS is a set of libraries for developers who want to build Wi-Fi Display applications on linux.

WDS consists of:

  • libwds: Main library implements a Wi-Fi Display dialect of RTSP that includes the parser, actual negotiation logic for sink and source, and the related data structures. It is not tied to any specific connection manager, media framework or main loop. This Library is also compatible with MSVC.
  • network: Supports integration with GLib main loop and GStreamer
  • p2p: Supports integration with Connman Wifi P2P features

The source code includes example implementations:

  • sink: Wi-Fi Display sink that depends on Gstreamer, Connman and GLib mainloop
  • desktop_source: Wi-Fi Display source that depends on Gstreamer, Connman and GLib mainloop

More information can be found on the mailing list and the wiki.

Requirements:

WDS test executables have runtime dependencies on just a few things (mostly GStreamer and GLib), but for successful Wi-Fi Display sessions the following are adviced:

  • Wifi adapter from Intel 7260-family or Atheros ath9k
  • wpa_supplicant: version 2.4 or later, built with CONFIG_P2P=y, CONFIG_WIFI_DISPLAY=y and CONFIG_CTRL_IFACE_DBUS_NEW=y
  • connman: version 1.28 (released Feb 1st 2015) or later.
  • gstreamer: either master branch more recent than Feb 3rd 2015 (commit d0a50be2), or 1.4 branch more recent than Feb 3rd 2005 (commit 1ce3260a638d or release 1.4.6 or later).

Test results with other Wifi adapters are very welcome but be warned that in many cases Wifi-P2P has not had the testing it needs on linux: you may run into problems in surprising places.

……

 

因是擇取或可補足者也。

# WiFi USB dongle
Wiphy phy1
	max # scan SSIDs: 4
	max scan IEs length: 2257 bytes
	Retry short limit: 7
	Retry long limit: 4
	Coverage class: 0 (up to 0m)
	Device supports RSN-IBSS.
	Supported Ciphers:
		* WEP40 (00-0f-ac:1)
		* WEP104 (00-0f-ac:5)
		* TKIP (00-0f-ac:2)
		* CCMP (00-0f-ac:4)
		* 00-0f-ac:10
		* GCMP (00-0f-ac:8)
		* 00-0f-ac:9
	Available Antennas: TX 0 RX 0
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * WDS
		 * monitor
		 * mesh point

# raspberry pi 3B WiFi
Wiphy phy0
 max # scan SSIDs: 10
 max scan IEs length: 2048 bytes
 Retry short limit: 7
 Retry long limit: 4
 Coverage class: 0 (up to 0m)
 Device supports T-DLS.
 Supported Ciphers:
 * WEP40 (00-0f-ac:1)
 * WEP104 (00-0f-ac:5)
 * TKIP (00-0f-ac:2)
 * CCMP (00-0f-ac:4)
 * CMAC (00-0f-ac:6)
 Available Antennas: TX 0 RX 0
 Supported interface modes:
 * IBSS
 * managed
 * AP
 * P2P-client
 * P2P-GO
 * P2P-device

 

 

 

 

 

 

 

 

 

飛行派工作日誌《三》

雖然簡單的 PoE injector 與 splitter 並沒有什麼 LLDP-MDI 電源管理機能,假使為了『不時之需』,先知道什麼是 LLDP

鏈路層發現協定

鏈路層發現協定Link Layer Discovery Protocol,LLDP)是一種資料鏈路層協定,網路裝置可以通過在本地網路中傳送LLPDU(Link Layer Discovery Protocol Data Unit)來通告其他裝置自身的狀態。是一種能夠使網路中的裝置互相發現並通告狀態、互動資訊的協定 。

……

Link Layer Discovery Protocol

The Link Layer Discovery Protocol (LLDP) is a vendor-neutral link layer protocol in the Internet Protocol Suite used by network devices for advertising their identity, capabilities, and neighbors on an IEEE 802 local area network, principally wired Ethernet.[1] The protocol is formally referred to by the IEEE as Station and Media Access Control Connectivity Discovery specified in IEEE 802.1AB[2] and IEEE 802.3-2012 section 6 clause 79.

LLDP performs functions similar to several proprietary protocols, such as Cisco Discovery Protocol, Foundry Discovery Protocol, Nortel Discovery Protocol and Link Layer Topology Discovery.

Information gathered

Information gathered with LLDP is stored in the device as a management information database (MIB) and can be queried with the Simple Network Management Protocol (SNMP) as specified in RFC 2922. The topology of an LLDP-enabled network can be discovered by crawling the hosts and querying this database. Information that may be retrieved include:

  • System name and description
  • Port name and description
  • VLAN name
  • IP management address
  • System capabilities (switching, routing, etc.)
  • MAC/PHY information
  • MDI power
  • Link aggregation

Applications

The Link Layer Discovery Protocol may be used as a component in network management and monitoring applications. One such example is its use in data center bridging requirements.[3]

The Data Center Bridging Capabilities Exchange Protocol (DCBX) is a discovery and capability exchange protocol that is used for conveying capabilities and configuration of the above features between neighbors to ensure consistent configuration across the network.[4]

 

也許也有好處??

於是乎順道查詢了一下

lldpd: implementation of IEEE 802.1ab (LLDP)

Features

LLDP (Link Layer Discovery Protocol) is an industry standard protocol designed to supplant proprietary Link-Layer protocols such as Extreme’s EDP (Extreme Discovery Protocol) and CDP (Cisco Discovery Protocol). The goal of LLDP is to provide an inter-vendor compatible mechanism to deliver Link-Layer notifications to adjacent network devices.

lldpd implements both reception and sending. It also implements an SNMP subagent for net-snmp to get local and remote LLDP information. The LLDP-MIB is partially implemented but the most useful tables are here. lldpd also partially implements LLDP-MED.

lldpd supports bridge, vlan and bonding.

The following OS are supported:

  • FreeBSD
  • GNU/Linux
  • OS X
  • NetBSD
  • OpenBSD
  • Solaris

Windows is not supported but you can use WinLLDPService as a transmit-only agent.

 

目前建制之狀況。

了解了一下 raspbian jessie 的支援情形︰

sudo apt-get install lldpd

cat /etc/default/lldpd
# Uncomment to start SNMP subagent and enable CDP, SONMP and EDP protocol

DAEMON_ARGS=”-x -c -s -e”

 

總是『書有用時,讀不嫌早』的耶!!

pi@raspberrypi:~ lldpcli  [lldpcli] show neighbors
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
[lldpcli] show configuration ------------------------------------------------------------------------------- Global configuration: ------------------------------------------------------------------------------- Configuration:   Transmit delay: 30   Transmit hold: 4   Receive mode: no   Pattern for management addresses: (none)   Interface pattern: (none)   Interface pattern for chassis ID: (none)   Override description with: (none)   Override platform with: (none)   Override system name with: (none)   Advertise version: yes   Update interface descriptions: no   Promiscuous mode on managed interfaces: no   Disable LLDP-MED inventory: yes   LLDP-MED fast start mechanism: yes   LLDP-MED fast start interval: 1   Source MAC for LLDP frames on bond slaves: local   Portid TLV Subtype for lldp frames: unknown ------------------------------------------------------------------------------- [lldpcli] show statistics
-------------------------------------------------------------------------------
LLDP statistics:
-------------------------------------------------------------------------------
Interface:    eth0
  Transmitted:  149
  Received:     0
  Discarded:    0
  Unrecognized: 0
  Ageout:       0
  Inserted:     0
  Deleted:      0
-------------------------------------------------------------------------------
[lldpcli] </pre>   <pre class="lang:default decode:true">pi@raspberrypi:~ sudo tcpdump -s0 -vv -pni eth0 ether dst 01:80:c2:00:00:0e
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
16:18:39.814059 LLDP, length 178
	Chassis ID TLV (1), length 7
	  Subtype MAC address (4): b8:27:eb:8a:12:64
	  0x0000:  04b8 27eb 8a12 64
	Port ID TLV (2), length 7
	  Subtype MAC address (3): b8:27:eb:8a:12:64
	  0x0000:  03b8 27eb 8a12 64
	Time to Live TLV (3), length 2: TTL 120s
	  0x0000:  0078
	System Name TLV (5), length 11: raspberrypi
	  0x0000:  7261 7370 6265 7272 7970 69
	System Description TLV (6), length 91
	  Raspbian GNU/Linux 8 (jessie) Linux 4.4.32-v7+ #926 SMP Fri Nov 18 13:40:49 GMT 2016 armv7l
	  0x0000:  5261 7370 6269 616e 2047 4e55 2f4c 696e
	  0x0010:  7578 2038 2028 6a65 7373 6965 2920 4c69
	  0x0020:  6e75 7820 342e 342e 3332 2d76 372b 2023
	  0x0030:  3932 3620 534d 5020 4672 6920 4e6f 7620
	  0x0040:  3138 2031 333a 3430 3a34 3920 474d 5420
	  0x0050:  3230 3136 2061 726d 7637 6c
	System Capabilities TLV (7), length 4
	  System  Capabilities [Bridge, WLAN AP, Router, Station Only] (0x009c)
	  Enabled Capabilities [Station Only] (0x0080)
	  0x0000:  009c 0080
	Management Address TLV (8), length 12
	  Management Address length 5, AFI IPv4 (1): 5.168.168.19
	  Interface Index Interface Numbering (2): 2
	  0x0000:  0501 05a8 a813 0200 0000 0200
	Port Description TLV (4), length 4: eth0
	  0x0000:  6574 6830
	Organization specific TLV (127), length 9: OUI IEEE 802.3 Private (0x00120f)
	  Link aggregation Subtype (3)
	    aggregation status [supported], aggregation port ID 0
	  0x0000:  0012 0f03 0100 0000 00
	Organization specific TLV (127), length 9: OUI IEEE 802.3 Private (0x00120f)
	  MAC/PHY configuration/status Subtype (1)
	    autonegotiation [supported, enabled] (0x03)
	    PMD autoneg capability [10BASE-T hdx, 10BASE-T fdx, 100BASE-TX hdx, 100BASE-TX fdx, Pause for fdx links, Asym PAUSE for fdx] (0x6cc0)
	    MAU type 100BASETX fdx (0x0010)
	  0x0000:  0012 0f01 036c c000 10
	End TLV (0), length 0
16:19:09.814842 LLDP, length 178
	Chassis ID TLV (1), length 7
	  Subtype MAC address (4): b8:27:eb:8a:12:64
	  0x0000:  04b8 27eb 8a12 64
	Port ID TLV (2), length 7
	  Subtype MAC address (3): b8:27:eb:8a:12:64
	  0x0000:  03b8 27eb 8a12 64
	Time to Live TLV (3), length 2: TTL 120s
	  0x0000:  0078
	System Name TLV (5), length 11: raspberrypi
	  0x0000:  7261 7370 6265 7272 7970 69

 

 

 

 

 

 

 

 

 

 

飛行派工作日誌《二》

由於 IEEE PoE 規範文件看來是要購買的︰

IEEE P802.3afDTE Power via MDI Task Force


The work of the IEEE P802.3af DTE Power via MDI Task Force is now complete with the approval of IEEE Std 802.3af-2003 at the June 2003 IEEE Standards Board meeting.

IEEE Std. 802.3af-2003 is available from the IEEE.

 

此處只能引用

introduction_to_poe_802.3af_802.3at.pdf

文本作個簡介的了。

poe-1

 

poe-2

 

poe-3

 

poe-4

 

poe-5

 

poe-6

 

然後依造將來需求,選用

30W Gigabits PoE injector

Cat-5 Cable

basic-poe-solution-diagram

以及

PoE Splitter

poe_splitter

 

一切驗證正常也。

 

 

 

 

 

 

 

 

輕。鬆。學。部落客