OpenWrt Forum Archive

Topic: Displaying Wrong Mac Addresses For AP's In Range

The content of this topic has been archived on 27 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have a Linksys router with stock firmware broadcasting Internet wirelessly with a MAC address of XX:XX:XX:XX:4F:D1 and an Open-Mesh OM1P flashed with OpenWRT Kamikaze. When I bring up the LuCI web interface and have the OM1P scan for wireless signals in range, it sees the Linksys router (correct SSID and all) but displays an incorrect MAC address of XX:XX:XX:XX:4F:D3. The last character of the Linksys MAC is a '3' instead of the '1' it's supposed to be.

I flashed 3 more OM1P's and made no changes to the default configuration other than enabling wireless and got the same outcome on all of them. I've also plugged in several other wireless routers and access points (PicoStation2 HP's and other OM1P's with stock Open-Mesh firmware) and the OM1P with Kamikaze reads every single MAC address wrong. Some have 1 character in the address wrong and some have multiple characters in the address wrong and it is not consistently at the end of the MAC address. The position of the incorrect character(s) inconsistent and appears to be totally random.

Regardless of what character(s) or how many characters are off, why is it displaying an incorrect MAC address at all and what suggestions do you guys have to resolve this? Thanks in advance for your time and help.

-Hanzo

Be aware that the router's LAN switch and its wireless interface have different MAC adresses (and that fact may not be visible when you do "ifconfig" when your wireless interface is bridged with your LAN interface).

(Last edited by blubberdiblub on 23 Dec 2009, 00:19)

@blubberdiblub: Thanks for your reply. I remember reading somewhere OpenWRT wouldn't perform correctly with the Wireless in set to sta (Client Mode) if it was bridged and somewhere else that in order for AAP (Auto AP) to work in OpenWRT, wireless had to be in sta mode. So I changed the wireless to sta mode and then went to the lan and unchecked "bridge..." all from the LuCI web interface.

Here's what I'm trying to do. Maybe if I explain it better, you all will be able to help me better or maybe even explain a better way to accomplish the result I am trying to produce.

I've successfully flashed an Open-Mesh OM1P to OpenWRT Kamikaze, telnet'd into the device, set the root password, enable the LuCI web interface, reboot the device, accessed the web interface with a web browser, enabled Wireless, changed to sta (Client Mode), unbridge the LAN, ssh'd into the device and installed and start AAP (Auto AP). When AAP scans for suitable wireless connections, it finds the Linksys router and several other OM1P's with stock firmware all connected to the Internet, but AAP and just scanning for nearby AP's in LuCI both produce incorrect MAC's. Or so I thought. You could have hit the nail on the head when reminding me that the MAC address on the bottom of the Linksys router could be it's wired MAC address and not the MAC address it's using to broadcast wireless. With this in mind, the OM1P with Kamikazi is still not getting an Internet connection wirelessly and rebroadcasting it whether I configure Kamikaze to do this or run Auto AP.

Got any suggestions as to what I could do to get the device to grab an Internet connection from one wireless AP and not only rebroadcast it, but also send it through the ethernet port to the PC it's connected to rather than trying to act as a WAN (Internet) port.

And again, thanks in advance for your response. I appreciate it.

Ah, I think I see what causes your problem. Your wired interface is still configured to get an IP address via DHCP and set up a default route to a gateway (which usually connects to the internet). You would at least have to configure this as static.

But that solves only half of your problem. The correct solution for your setup would probably indeed be bridging, but you said this won't work correctly, so you have to find a different solution.

Probably the easiest way, tho surely a suboptimal one network-setup-wise, is to configure your wireless interface as the WAN interface, i.e. set that interface up to get its IP address via DHCP from your other routers wirelessly and configure a different subnet for your wired interface and just use masquerading, as if your wireless connection connected directly to your ISP, just in this case your other routers are your "ISP" wink

Another possibility is to use a kind of a "poor man's bridging". That is proxy arp. Either configure both interfaces, wired and wireless, static or let the wireless interface get its IP via DHCP. Then choose a subsubnet range inside the subnet your other routers are already handing out, but make sure this range is otherwise completely unused (i.e. outside your other routers DHCP lease range).
Let me use an example. Suppose your other routers are on 192.168.1.0/24 and are giving out DHCP leases in the range between 192.168.1.100 and 192.168.1.150 and have addresses between 192.168.1.1 and 192.168.1.5 themselves.
In this case you cannot use a /25 or /26 as subsubnet. /25 is not possible in any case, as 192.168.1.0/25 would already encompass 192.168.1.0 of your /24 and 192.168.1.128/25 would encompass 192.168.1.255 of your /24, which it must not, since that are the network and the broadcast address, respectively, and you would introduce serious problems into your network would you use those addresses both on your subnet and your subsubnet.
192.168.1.0/26 and 192.168.1.192/26 are not possible for the same reason, while 192.168.1.64/26 and 192.168.1.128/26 both clash with your DHCP range on your subnet. So you could either relocate your DHCP lease range or simply choose a smaller subsubnet.
192.168.1.160/27 would be possible for instance. Lets look at that example.
Say you set your IP on your wireless interface up as 192.168.1.10 (outside the subsubnet, of course) or have it assigned by DHCP (in the range between .100 and .150).
Your wired interface must be set up statically with an IP inside your subsubnet. Let's choose 192.168.1.161 (.160 is the network address and cannot be used). Netmask will be 255.255.255.224. If you want to hand out DHCP leases on that interface, you could use a range as big as 29 addresses (configure it as 28 in your dhcp config file), from 192.168.1.162 to 192.168.1.190, since 192.168.1.191 is your subsubnet's broadcast address.
Then enable proxy arp on both your wired and your wireless interface, so all arp requests get answered by your OM1P on behalf of all the clients on the respective other network segment, so as to have them actually route the packets to your OM1P if they want to talk to each other. You do that by echoing 1 into /proc/sys/net/ipv4/conf/THEINTERFACENAME/proxy_arp of both of your interfaces.  You could use a hotplug script for that.

Having said all that, I can't help you with configuring that over LuCI, since I don't use a web gui, I'm doing it all over ssh and the shell on the router.


Regards,
Niels Böhm

Hmm. I don't think I will have to go so far as to use a "poor man's bridge" and subnet off blocks of IP address, etc. As far as your statement re: not using LuCI and just ssh'ing into the device, I specifically chose the image with LuCI thinking the web interface would allow me to configure it quicker and easier, but I'm beginning to think I was wrong. It's actually quicker and easier to just ssh into it and edit the config files. I am very comfortable editing config files in shell so if you have any ideas that require me to do that, please feel free to post the code as I am most likely going to use the shell to continue troubleshooting this issue, anyway.

It appears to me that the wired interface is already set to a static IP. So how do I effectively get the wireless interface to pull Internet from AP's around it and send it to the PC via the wired interface. Do I use Client mode, enable DHCP somehow on the wireless interface effectively turning it to a wireless WAN port? It's currently in bridged mode (bridging the wireless and wired interface as 'lan') and the wireless interface is in "AP Mode." I assumed that changing the wireless Interface to sta (Client Mode) would give me the result I am looking for but it did not so I changed it back to the default setting. I do not have AAP (AutoAP) installed on the device I'm working on at the moment so disregard not being able to bridge the interfaces. I just need to get this guy pulling Internet from a wireless source and pumping to a PC through the wired interface first. Then I'll worry about whitelisting only the AP's I want it to access via AutoAP or maybe any other suggestions you guys may have.

Here's what "network" and "wireless" look like now. Tthe only change made was to enable wireless (option 'disabled' '0'):

NETWORK:

config 'interface' 'loopback'
    option 'ifname' 'lo'
    option 'proto' 'static'
    option 'ipaddr' '127.0.0.1'
    option 'netmask' '255.0.0.0'

config 'interface' 'lan'
    option 'ifname' 'eth0'
    option 'type' 'bridge'
    option 'proto' 'static'
    option 'ipaddr' '192.168.1.1'
    option 'netmask' '255.255.255.0'
    option 'dns' ''
    option 'gateway' ''

WIRELESS:

config 'wifi-device' 'wifi0'
    option 'type' 'atheros'
    option 'channel' 'auto'
    option 'disabled' '0'
    option 'diversity' '0'

config 'wifi-iface'
    option 'device' 'wifi0'
    option 'network' 'lan'
    option 'mode' 'ap'
    option 'ssid' 'OpenWrt'
    option 'encryption' 'none'

What is the best way to configure this to grab Internet access from a wireless source and send it to a PC via the wired interface

@hanzo_hasashi
Actually I found this thread by accident while searching for "autoap openwrt" at Google and I think I have a solution for your problem. If I got you right you'd like AAP to connect to surrounding APs while re-broadcasting the signal and providing internet access to the wired side in bridged configuration. Please have a look at my very own Piranha 3.0 setup and see if it helps ..

root@OpenWrt:~# cat /etc/config/network 
config 'interface' 'loopback'
    option 'ifname' 'lo'
    option 'proto' 'static'
    option 'ipaddr' '127.0.0.1'
    option 'netmask' '255.0.0.0'

config 'interface' 'wan'
    option 'proto' 'dhcp'

config 'interface' 'lan'
    option 'ifname' 'eth0'
    option 'type' 'bridge'
    option 'proto' 'static'
    option 'ipaddr' '10.0.0.1'
    option 'netmask' '255.255.255.0'
root@OpenWrt:~# cat /etc/config/wireless 
config 'wifi-device' 'wifi0'
    option 'type' 'atheros'
    option 'channel' 'auto'

config 'wifi-iface'
    option 'device' 'wifi0'
    option 'network' 'wan'
    option 'mode' 'sta'
    option 'ssid' 'OpenWrt'
    option 'encryption' 'none'
    
config 'wifi-iface'
    option 'device' 'wifi0'
    option 'network' 'lan'
    option 'mode' 'ap'
    option 'ssid' 'xxx'
    option 'encryption' 'psk2'
    option 'key' 'xxxxxxxx'

thanks for using AAP,
orange

The discussion might have continued from here.