dhcpclient linux - error messages during obtaining lease from router - linux

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.

Related

Booting Linux with Root Filesystem via NFS: Loops on "Sending DHCP and RARP requests ..."

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

SRX FW configuration

Try configure SRX FW , try set static arp
[edit interfaces ge-0/0/3 unit 0 family inet address 10.1.1.1/24]
user#host# set arp 10.1.1.3 mac 01:ff:85:7f:78:03
return :
Invalid unicast address at '01:ff:85:7f:78:03'
Why is this invalid?
Solved , happened IP is a Cluster IP which is Multicast mac
as simply say "mac" JunOS assumed unicast which is invalid
So say "multicast mac" and should be OK
Fun
Regards
Brian

Why are UDP packets sent from default interface address instead of the address where the client packet is received?

For a long time I had troubles using several software (early versions of Teamspeak 3, netcat, openvpn) communicating using UDP protocol. Today I identified the problem.
The main goal for me was to use openvpn over udp which did not seem to work on my server which has multiple ip addresses (runs Ubuntu Server Kernel 3.2.0-35-generic).
Using following config:
# ifconfig -a
eth0 Link encap:Ethernet HWaddr 11:11:11:11:11:11
inet addr:1.1.1.240 Bcast:1.1.1.255 Mask:255.255.255.224
...
# cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 1.1.1.240
broadcast 1.1.1.255
netmask 255.255.255.224
gateway 1.1.1.225
up ip addr add 1.1.1.249/27 dev eth0
down ip addr del 1.1.1.249/27 dev eth0
up ip addr add 2.2.2.59/29 dev eth0
down ip addr del 2.2.2.59/29 dev eth0
up route add -net 2.2.2.56 netmask 255.255.255.248 gw 2.2.2.57 eth0
# default route to access subnet
up route add -net 1.1.1.224 netmask 255.255.255.224 gw 1.1.1.225 eth0
Problem:
A simple tcpdump at the server reveals that udp packets (tested with netcat and openvpn) received at 2.2.2.59 are replied from 1.1.1.240 (client: 123.11.22.33)
13:55:30.253472 IP 123.11.22.33.54489 > 2.2.2.59.1223: UDP, length 5
13:55:36.826658 IP 1.1.1.240.1223 > 123.11.22.33.54489: UDP, length 5
Question:
Is this problem due to wrong configuration of the network interface or the application itself (OpenVPN, netcat)?
Is it possible for the/an application to listen on multiple ip addresses and reply from the interface address where it received the packet on UDP like it's doing when using TCP.
I know that you can bind applications for specific ip but that would not be the way to go.
I cannot see that this behaviour is due to the UDP protocol itself, since the application is possible to determine at which interface address the packet was received.
Specifically, openvpn has the --multihome option for handling this scenario correctly.

Command line connect to wireless network does not work on ubuntu 10.04

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....)

dnsmasq with iPhone failing

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.

Resources