I am trying to use dnsmasq on Linux to serve as a wifi access point. Windows 7 and an Android smart phone can connect just fine to the Linux system but my iPhone cannot. Both Windows and the iPhone authenticate just fine with wpa_supplicant, but the problem is that the iPhone never gets an ip address.
My config file is very simple for dnsmasq.conf:
# Only listen for DHCP on wlan0
interface=wlan0
# Create a dhcp range on your /24 wlan0 network with a lease time
dhcp-range=192.168.1.6,192.168.1.15,255.255.255.0,5m
# Configure DHCP
dhcp-option=3
dhcp-option=6
# Be authoritative with Windows
dhcp-authoritative
The dnsmasq debug log shows this for Windows and you can see it is successful:
dnsmasq: started, version 2.65 cachesize 150
dnsmasq: compile time options: no-IPv6 GNU-getopt DBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack
dnsmasq-dhcp: DHCP, IP range 192.168.1.6 -- 192.168.1.15, lease time 5m
dnsmasq: failed to access /etc/resolv.conf: No such file or directory
dnsmasq: failed to load names from /etc/hosts: No such file or directory
dnsmasq-dhcp: DHCPREQUEST(wlan0) 192.168.1.14 24:77:03:2b:79:20
dnsmasq-dhcp: Ignoring domain global.tektronix.net for DHCP host name PC-MSP-183B
dnsmasq-dhcp: DHCPACK(wlan0) 192.168.1.14 24:77:03:2b:79:20 PC-MSP-183B
dnsmasq-dhcp: DHCPINFORM(wlan0) 192.168.1.14 24:77:03:2b:79:20
dnsmasq-dhcp: DHCPACK(wlan0) 192.168.1.14 24:77:03:2b:79:20 PC-MSP-183B
However, it shows this for the iPhone:
dnsmasq: started, version 2.65 cachesize 150
dnsmasq: compile time options: no-IPv6 GNU-getopt DBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack
dnsmasq-dhcp: DHCP, IP range 192.168.1.6 -- 192.168.1.15, lease time 5m
dnsmasq: failed to access /etc/resolv.conf: No such file or directory
dnsmasq: failed to load names from /etc/hosts: No such file or directory
dnsmasq-dhcp: DHCPREQUEST(wlan0) 192.168.1.15 84:38:35:df:5f:c2
dnsmasq-dhcp: DHCPACK(wlan0) 192.168.1.15 84:38:35:df:5f:c2 iPhone
dnsmasq-dhcp: DHCPREQUEST(wlan0) 192.168.1.15 84:38:35:df:5f:c2
dnsmasq-dhcp: DHCPACK(wlan0) 192.168.1.15 84:38:35:df:5f:c2 iPhone
And it just sits there!
Any suggestions or help? Thanks!
It works with iPhone if you remove the following option:
dhcp-option=3
Comment that out and iPhone can connect.
Related
as a linux debian client of tplink deco router with fixed ip reservation on router i get this:
eth0: offered 192.168.68.111 from 192.168.68.1
Oct 26 20:22:42 home dhcpcd[654]: eth0: NAK: REQUEST for invalid Requested IP Address from 192.168.1.1
Oct 26 20:22:42 home dhcpcd[654]: eth0: message: REQUEST for invalid Requested IP Address
192.168.68.11 is OK this is configured on the router software
192.168.68.1 is the router IP...
but i don't know why there is a 192.168.1.1 in the logs... it's also used as a resolv.conf entry:
nameserver 192.168.1.1
nameserver 192.168.68.1
which is obviously bad there is no 192.168.1.1 in the network.
cat /var/lib/dhcp/dhclient.leases
lease {
interface "eth0";
fixed-address 192.168.68.111;
option subnet-mask 255.255.255.0;
option dhcp-lease-time 7200;
option routers 192.168.68.1;
option dhcp-message-type 5;
option dhcp-server-identifier 192.168.68.1;
option domain-name-servers 192.168.1.1,192.168.68.1;
renew 3 2022/10/26 21:02:02;
rebind 3 2022/10/26 21:59:27;
expire 3 2022/10/26 22:14:27;
}
any ideas?
i just want to get rid of the warnings ;)
you need to check the server configuration file if 192.168.1.1 is configured as dns server.
I am facing an issue while configuring rdma and Infiniband on my two nodes. Both of these two nodes are connected and I have installed the recommended software libraries and packages required.
But my port status is down and physical state is Disabled. I tried to enable the state but I get the error of can’t open MAD PORT
:~# ibportstate -L 1 3 enable
ibwarn: [6772] mad_rpc_open_port: can't open UMAD port ((null):0)
ibportstate: iberror: failed: Failed to open '(null)' port '0'
Infiniband ibstatus returns this:
Infiniband device ‘mlx5_0’ port 1 status:
default gid: fe80:0000:0000:0000:1270:fdff:fe6e:43e0
base lid: 0x0
sm lid: 0x0
state: 1: DOWN
phys state: 3: Disabled
rate: 100 Gb/sec (4X EDR)
link_layer: Ethernet
I don't understand what seems to be the issue here, I also upgraded the firmware but still the problem persists.
I figured it out and I am sharing the answers for others to see so the issue was the network interface, you need to see which network interface the Infiniband and check the status.
root#dtn0:~# /etc/init.d/openibd status
HCA driver loaded
Configured Mellanox EN devices:
ens11np0
Currently active Mellanox devices:
The following OFED modules are loaded:
rdma_ucm
rdma_cm
ib_ipoib
mlx5_core
mlx5_ib
ib_uverbs
ib_umad
ib_cm
ib_core
mlxfw
After that, I just assigned Ip and netmask on the interface and I was able to use the interface and reach the network.
root#dtn0:~# ifconfig ens11np0 10.0.0.50/24
I'm trying to boot the Beaglebone Black with the kernel still on my host machine via NFS. I'm under the impression that it is not necessary for my host machine to be a DHCP server, and that manual IPv4 static IPs are sufficient. The boot process ends up looping on the following:
[ 357.280386] IP-Config: Retrying forever (NFS root)...
[ 357.285865] net eth0: initializing cpsw version 1.12 (0)
[ 357.393659] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver
[SMSC LAN8710/LAN8720] (mii_bus:phy_addr=4a101000.mdio:00, irq=-1)
[ 357.412716] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 360.563747] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 360.572294] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 360.593014] Sending DHCP and RARP requests .....
Relevant bootargs/bootcmd:
U-Boot# echo $nfs_bootcmd
tftp 0x81000000 zImage; tftp 0x82000000 am335x-boneblack.dtb; bootz 0x81000000 - 0x82000000
U-Boot# echo $bootargs
root=/dev/nfs rw ip=192.168.0.100:192.168.0.1:::eth0:off console=ttyO0 nfsroot=192.168.0.1:/nfsroot nfsrootdebug
U-Boot# echo $ipaddr
192.168.0.100
U-Boot# echo $serverip
192.168.0.1
My /etc/exports:
/nfsroot *(rw,no_root_squash,no_subtree_check)
Here is the serial output during boot: Linux boot via NFS.
HW/SW Setup:
Beaglebone Black
Ethernet connected from host directly to target board (no router/switch/hub in between)
tftp working fine
rootfs seems to mount fine through NFS
Host machine is NOT setup as a dhcp server
u-boot/Linux
Is it necessary to make my host machine a dhcp server? How do I fix this?
Thanks in advance.
I fixed this by setting up a DHCP server on my host machine. After installing isc-dhcp-server (on Ubuntu), I modified /etc/dhcp/dhcpd.conf to look like so:
# /etc/dhcp/dhcpd.conf
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.0 192.168.0.254;
}
# the host name doesn't need to match anything.
host beaglebone {
# MAC address from U-boot's ethaddr env var
hardware ethernet 04:a3:16:f5:1a:56;
# The static IP to be allocated to the beaglebone device
fixed-address 192.168.0.100;
}
This solved the issue and the device boots up correctly.
You are able to use NFS to boot your device while retaining a static network configuration rather than having to use DHCP.
Using what you have provided above, it would be similar to something like this.
U-Boot# echo $nfs_bootcmd
tftp 0x81000000 zImage; tftp 0x82000000 am335x-boneblack.dtb; bootz 0x81000000 - 0x82000000
U-Boot# echo $bootargs
root=/dev/nfs nfsroot=192.168.0.1:/nfsroot,nolock,nfsvers=3 nfsrootdebug nfsaddrs=192.168.0.100:192.168.0.1::255.255.255.0:::none rw console=ttyO0
U-Boot# echo $ipaddr
192.168.0.100
U-Boot# echo $serverip
192.168.0.1
My Dear All the Greatest Lords,
Some expert listed the details of connecting to a wireless network as,
This is a step-to-step guide for connecting to a WPA/WPA2 WiFi network via the Linux command line interface. The tools are:
wpa_supplicant
iw
ip
ping
iw is the basic tool for WiFi network-related tasks, such as finding the WiFi device name, and scanning access points. wpa_supplicant is the wireless tool for connecting to a WPA/WPA2 network. ip is used for enabling/disabling devices, and finding out general network interface information.
The steps for connecting to a WPA/WPA2 network are:
Find out the wireless device name.
$ /sbin/iw dev
phy#0
Interface wlan0
ifindex 3
type managed
The above output showed that the system has 1 physical WiFi card, designated as phy#0. The device name is wlan0. The type specifies the operation mode of the wireless device. managed means the device is a WiFi station or client that connects to an access point.
Check that the wireless device is up.
$ ip link show wlan0
3: wlan0: (BROADCAST,MULTICAST) mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
link/ether 74:e5:43:a1:ce:65 brd ff:ff:ff:ff:ff:ff
Look for the word "UP" inside the brackets in the first line of the output.
In the above example, wlan0 is not UP. Execute the following command to bring it up:
$ sudo ip link set wlan0 up
[sudo] password for peter:
Note: you need root privilege for the above operation.
If you run the show link command again, you can tell that wlan0 is now UP.
$ ip link show wlan0
3: wlan0: (NO-CARRIER,BROADCAST,MULTICAST,UP) mtu 1500 qdisc mq state DOWN mode DEFAULT qlen 1000
link/ether 74:e5:43:a1:ce:65 brd ff:ff:ff:ff:ff:ff
Check the connection status.
$ /sbin/iw wlan0 link
Not connected.
The above output shows that you are not connected to any network.
Scan to find out what WiFi network(s) are detected
$ sudo /sbin/iw wlan0 scan
BSS 00:14:d1:9c:1f:c8 (on wlan0)
... sniped ...
freq: 2412
SSID: stanford
RSN: * Version: 1
* Group cipher: CCMP
* Pairwise ciphers: CCMP
* Authentication suites: PSK
* Capabilities: (0x0000)
... sniped ...
The 2 important pieces of information from the above are the SSID and the security protocol (WPA/WPA2 vs WEP). The SSID from the above example is stanford. The security protocol is RSN, also commonly referred to as WPA2. The security protocol is important because it determines what tool you use to connect to the network.
Connect to WPA/WPA2 WiFi network.
This is a 2 step process. First, you generate a configuration file for wpa_supplicant that contains the pre-shared key ("passphrase") for the WiFi network.
$ sudo -s
[sudo] password for peter:
$ wpa_passphrase stanford >> /etc/wpa_supplicant.conf
...type in the passphrase and hit enter...
wpa_passphrase takes the SSID as the single argument. You must type in the passphrase for the WiFi network stanford after you run the command. Using that information, wpa_passphrase will output the necessary configuration statements to the standard output. Those statements are appended to the wpa_supplicant configuration file located at /etc/wpa_supplicant.conf.
Note: you need root privilege to write to /etc/wpa_supplicant.conf.
$ cat /etc/wpa_supplicant.conf
# reading passphrase from stdin
network={
ssid="stanford"
#psk="testtest"
psk=4dfe1c985520d26a13e932bf0acb1d4580461dd854ed79ad1a88ec221a802061
}
The second step is to run wpa_supplicant with the new configuration file.
$ sudo wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf
-B means run wpa_supplicant in the background.
-D specifies the wireless driver. wext is the generic driver.
-c specifies the path for the configuration file.
Use the iw command to verify that you are indeed connected to the SSID.
$ /sbin/iw wlan0 link
Connected to 00:14:d1:9c:1f:c8 (on wlan0)
SSID: stanford
freq: 2412
RX: 63825 bytes (471 packets)
TX: 1344 bytes (12 packets)
signal: -27 dBm
tx bitrate: 6.5 MBit/s MCS 0
bss flags: short-slot-time
dtim period: 0
beacon int: 100
Obtain IP address by DHCP
$ sudo dhclient wlan0
Use the ip command to verify the IP address assigned by DHCP. The IP address is 192.168.1.113 from below.
$ ip addr show wlan0
3: wlan0: mtu 1500 qdisc mq state UP qlen 1000
link/ether 74:e5:43:a1:ce:65 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.113/24 brd 192.168.1.255 scope global wlan0
inet6 fe80::76e5:43ff:fea1:ce65/64 scope link
valid_lft forever preferred_lft forever
Add default routing rule.
The last configuration step is to make sure that you have the proper routing rules.
$ ip route show
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.113
The above routing table contains only 1 rule which redirects all traffic destined for the local subnet (192.168.1.x) to the wlan0 interface. You may want to add a default routing rule to pass all other traffic through wlan0 as well.
$ sudo ip route add default via 192.168.1.254 dev wlan0
$ ip route show
default via 192.168.1.254 dev wlan0
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.113
ping external ip address to test connectivity
$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=48 time=135 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=48 time=135 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=48 time=134 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 134.575/134.972/135.241/0.414 ms
The above series of steps is a very verbose explanation of how to connect a WPA/WPA2 WiFi network. Some steps can be skipped as you connect to the same access point for a second time. For instance, you already know the WiFi device name, and the configuration file is already set up for the network. The process needs to be tailored according to your situation.
Thoroughly followed the above tutorial, I failed to connect the wireless router.
(working as root)
......
#wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D wext
#iw wlan0 link
Not connected.
Even I disable the WPA authentication using,
iwconfig wlan0 essid XXXXXXXXXXXXX
of no avail.
But the GNOME wireless tray is functioning(can select, connect, disconnect etc.)
Thank you a lot in advance.
Latest wpa_supplicant is able to do all the job itself.
The wpa_supplicant option you wrote seem to me ok.
But please, check the options in the file "/etc/wpa_supplicant.conf", if it readable and is well written (ssid,wpa,password correct....)
Standalone mode
When I start WSO2 CEP server on my linux machine, the ip address which is displayed in the logs as below
Mgt Console URL : https://<172.16.55.1>:9443/carbon/
When I run netstat on that port, as below
linux-0rla:/test/home/CEP/data # netstat -tulpn | grep 9443
tcp 0 0 :::9443 :::* LISTEN 28882/java
ifconfig on machine shows
enp0s25 Link encap:Ethernet HWaddr 64:31:50:42:93:17
inet addr:10.201.1.171 Bcast:10.201.255.255 Mask:255.255.0.0
vmnet8 Link encap:Ethernet HWaddr 00:50:56:C0:00:08
inet addr:172.16.55.1 Bcast:172.16.55.255 Mask:255.255.255.0
The ip which my machine has exposed is 10.201.1.171, so ideally CEP server should have started on this ip only. Although it is accessible from eth0 ip as well from another machine.
HA mode
Now when I setup similar 2 machines for HA setup, this time the thrift ip also had similar issue.
When I start WSO2 CEP server on my linux machine, the ip address which is displayed in the logs as below
Thrift Server started at 172.16.55.1
Thrift SSL port : 7711
Thrift port : 7611
When I run netstat on that port, as below
linux-0rla:/test/home/CEP/data # netstat -tulpn | grep 7611
tcp 0 0 172.16.55.1:7611 :::* LISTEN 28882/java
But here these 2 machines are not able to communicate with each other over thrift port for inter node transfer of events.
When I created HA setup on same machine in different folders, now it was working fine.
Is there a way to tell WSO2 CEP to start thrift and server on particular ip address ???
The problem of CEP server getting started at vmnet8 address is due to VMWare running in your machine. You can check that with:
sudo /etc/init.d/vmware status
If VMWare is running, you can stop that with:
sudo /etc/init.d/vmware stop
An then start the CEP again. Now the server will start on your machine's ip.