Armbian hostname and WiFi configuration
In previous post i have described installation of Armbian on Orange Pi PC Plus. Now is the time for some initial configuration
(hostname and WIFI setup).
Table of Contents
Changing hostname
- Check current hostname with
hostname - Check current fully qualified domain name (or FQDN) with
hostname --fqd - Set new hostname:
sudo hostname pi - Update
/etc/hostnamefor Debian to get new hostname after reboot Update
/etc/hostsso that FQDN is before short localhost next to IP:127.0.0.1 pi.example.com pi localhost
::1 pi.example.com pi localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Reboot with
sudo reboot
Configuring WIFI to work with WPA2
There are various ways for configuring WIFI with wpa_suplicant. You may consider settings things up in /etc/network/interfaces if you want WIFI
to be started automatically upon system startup. I have decided on another approach: using script for starting all manually.
- wpa_supplicant should be installed but needs to be run as root:
sudo wpa_supplicant -v.` - In the next steps you will need BSSID (access point MAC address) and channel. Turn on your WIFI card with
sudo ifconfig wlan0 upand scan for
your network withsudo iwlist wlan0 scan | egrep 'Address|ESSID|Channel'. - Prepare configuration file for wpa_supplicant in
/etc/wpa_supplicantfolder. You could have more files there with different names. Our file
will be namedwifi.conf. Adjust the content of the file: replace
00:14:6C:AE:EA:AE,my-wifiandP@ssw0rdwith
your access point MAC address, your WIFI network name and your WIFI password respectively:ctrl_interface=DIR=/var/run/wpa_supplicant
network={
bssid=00:14:6C:AE:EA:AE
ssid="my-wifi"
scan_ssid=1
key_mgmt=WPA-PSK
psk="P@ssw0rd"
}
Create a script and add execute permissions. Replace
my-wifi,8andwifi.confwith
your WIFI name, channel and WPA supplicant configuration file name:#!/usr/bin/env bash
DEV=$(iw dev | awk '/Interface/ {interf=$2} END {print interf}')
DHCL_PIDFILE=/var/run/dhclient-$DEV.pid
WPA_PIDFILE=/var/run/wpa_supplicant-$DEV.pid
if [[ -f $DHCL_PIDFILE ]] && kill -9 $(cat $DHCL_PIDFILE)
then
dhclient -v -r $DEV
echo "IP address released"
fi
if [[ -f $WPA_PIDFILE ]] && kill -9 $(cat $WPA_PIDFILE)
then
echo "WPA supplicant killed"
fi
killall wpa_supplicant
echo "wpa_supplicant killed :)"
ifconfig -v $DEV down
sleep 1
ifconfig -v $DEV up
echo "$DEV interface is up again"
iwconfig $DEV essid 'my-wifi' channel 8
echo "starting wpa_supplicant.."
sleep 2
wpa_supplicant -B -dd -i$DEV -P$WPA_PIDFILE -c/etc/wpa_supplicant/wifi.conf
sleep 2
echo "getting IP address.."
dhclient -v -pf $DHCL_PIDFILE $DEV
Run the script as root
Armbian hostname and WiFi configuration的更多相关文章
- 最简单的RASPBERRY PI wifi配置
Setting up Wifi with the Command Line SIMON MONK This tutorial works best if your router is broad ...
- Docker Network Configuration 高级网络配置
Network Configuration TL;DR When Docker starts, it creates a virtual interface named docker0 on the ...
- 树莓派 Zero W——随身钥匙扣
前言 原创文章,转载引用务必注明链接.水平有限,如有疏漏,欢迎指正. 本文使用Markdown写成,为获得更好的阅读体验和正确的格式显示,请访问我的博客原文: http://www.cnblogs.c ...
- 【译】Android 6.0 Changes (机翻加轻微人工校对)
Android 6.0 Changes In this document Runtime Permissions Doze and App Standby Apache HTTP Client Rem ...
- Android M新特性之Behavior Changes
1.Runtime Permissions On your apps that target the M Preview release or higher, make sure to check f ...
- 分布式Hadoop安装(一)
本文旨在介绍通过两台物理节点,实现完全分布式hadoop程序的部署 writen by Bob Pan@20140609 环境介绍: 主机名 机器IP 用途 描述 Hadoop0 192.168.80 ...
- hadoop完全分布式模式的安装和配置
本文是将三台电脑用路由器搭建本地局域网,系统为centos6.5,已经实验验证,搭建成功. 一.设置静态IP&修改主机名&关闭防火墙(all-root)(对三台电脑都需要进行操作) 0 ...
- Hadoop1.1.2伪分布式安装笔记
一.设置Linux的静态IP 修改桌面图标修改,或者修改配置文件修改 1.先执行ifconfig,得到网络设备的名称eth0 2.编辑/etc/sysconfig/network-scripts/if ...
- 智传播客hadoop视频学习笔记(共2天)
第一天:1.答疑解惑• 就业前景• 学习hadoop要有什么基础• hadoop会像塞班一样,热一阵子吗• hadoop学习起来容易还是困难• 课堂上的学习方法(所有实验必须按照要求做,重原 ...
随机推荐
- vue 连接后台
在 index.js 中可以配置后台的地址:代理的方式: 这个文件在 config 中 proxyTable: { // 连接后台 '/api':{ target:"http://new.w ...
- 紫书 习题 8-2 UVa 1610 (暴力出奇迹)
这道题我真的想的非常的复杂, 拿草稿纸一直在找规律,推公式, 然后总有一些特殊的情况. 然后就WA了N次.无奈之下看了别人的博客, 然后就惊了.直接暴力枚举两个相邻字符串 里面的所有可能就可以了--真 ...
- Opencv 三对角线矩阵(Tridiagonal Matrix)解法之(Thomas Algorithm)
1. 简介 三对角线矩阵(Tridiagonal Matrix),结构如公式(1)所示: aixi−1+bixi+cixx+1=di(1) 其中a1=0,cn=0.写成矩阵形式如(2): ⎡⎣⎢⎢⎢⎢ ...
- ASP.NET-使用事件监视诊断程序异常
用windows自带的事件监视程序来监视网站的异常 来自为知笔记(Wiz)
- SQLSever: 怎样在select中的每一行产生不同的随机数?
select 的随机函数有点假, 或许是由于它是基于时间来的吧, 同一select中由于时间无法错开导致产生的随机数都是一样的. 怎样做到让不同的行拥有不同的随机数呢? 以下以产生某个月的随机日期来演 ...
- MDNS DDoS 反射放大攻击——攻击者假冒被攻击者IP向网络发送DNS请求,域名为“_services._dns-sd._udp.local”,这将引起本地网络中所有提供服务的主机都向被攻击者IP发送DNS响应,列举网络中所有服务
MDNS Reflection DDoS 2015年3月,有报告叙述了mDNS 成为反射式和放大式 DDoS 攻击中所用媒介的可能性,并详述了 mDNS 反射式攻击的原理和相应防御方式.Q3,Akam ...
- 利用Matlab自带的深度学习工具进行车辆区域检测与车型识别【Github更新!!!】(三)
前言 对前面的东西更新了一下.地方包括: 1.GUI的更新,更友好的用户界面 2.支持用手直接画车辆区域,并且识别出来 3.将proposal.detect.fine-grained classifi ...
- springboot shiro配置
导入相关包(这里配合使用Ehcache缓存) <dependency> <groupId>org.apache.shiro</groupId> <artifa ...
- 机器学习(七) PCA与梯度上升法 (上)
一.什么是PCA 主成分分析 Principal Component Analysis 一个非监督学的学习算法 主要用于数据的降维 通过降维,可以发现更便于人类理解的特征 其他应用:可视化:去噪 第一 ...
- PostgreSQL Replication之第八章 与pgbouncer一起工作(2)
8.2 安装pgbouncer 在我们深入细节之前,我们将看看如何安装pgbouncer.正如PostgreSQL一样,您可以采取两种途径.您可以安装二进制包或者直接从源代码编译.在我们的例子中,我们 ...