Skip to content

Entries from November 2015.

Conflicting DHCP server locator under Linux

cable-ethernetIn order to locate conflicting DHCP server in your LAN execute the following command:

sudo dhcpdump -i eth4 | awk '/IP:/{SRC=$2 " " $3} /OP:.*BOOTPREPLY/{ print "DHCP server found:", SRC; }'

The restart your PC network (use DHCP to get new IP). If you see more than one IP address here:

DHCP server found: (0:9:6b:a3:fc:4a) DHCP server found: (f8:d1:11:9e:1d:8b) DHCP server found: (0:9:6b:a3:fc:4a) DHCP server found: (f8:d1:11:9e:1d:8b) DHCP server found: (0:9:6b:a3:fc:4a)

Then you have two, conflicting DHCP servers in your network. You can use tool to locate the device type that causes the problems.

Setting up proper terminal size for serial connection to an embedded device

consoleWhen you work over serial line on an embedded device usually the terminal size it set to 80x25.

There's an easy way, however, to setup your real terminal size, just add the following line to your profile script (~/.profile):

resize > /tmp/resize . /tmp/resize

resize command detects real terminal size and sets COLUMNS and ROWS parameters accordingly:

# resize COLUMNS=159;LINES=52;export COLUMNS LINES;

One just need to execute the output as sh commands (using source "." command).