Last active
January 31, 2018 14:05
-
-
Save muhamadazmy/38735960c82a53d49eea29f39e063f92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#SET TO DESTINATION IP | |
DEST_IP='172.17.0.1' | |
#CHANGE IF NECESSARY (the dest ip should be reachable from eth0) | |
DEV=eth0 | |
dmesg -n 7 | |
modprobe configfs | |
modprobe netconsole | |
mount none -t configfs /sys/kernel/config | |
# 'netconsole' dir is auto created if the module is loaded | |
mkdir /sys/kernel/config/netconsole/target1 | |
cd /sys/kernel/config/netconsole/target1 | |
# set local IP address | |
ip a show ${DEV} |grep -oE '[0-9]+\.[0-9]+\.[0-9]+.[0-9]+' > local_ip | |
# set destination IP address | |
echo ${DEST_IP} > remote_ip | |
# set local network device name (find it trough ifconfig, examples: eth0, eno1, wlan0) | |
echo $DEV > dev_name | |
# find destination MAC address | |
arping $(cat remote_ip) -f | grep -o ..:..:..:..:..:.. > remote_mac | |
echo 1 > enabled |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment