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

  1. Check current hostname with hostname
  2. Check current fully qualified domain name (or FQDN) with hostname --fqd
  3. Set new hostname: sudo hostname pi
  4. Update /etc/hostname for Debian to get new hostname after reboot
  5. Update /etc/hosts so 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
  6. 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.

  1. wpa_supplicant should be installed but needs to be run as root: sudo wpa_supplicant -v.`
  2. 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 with sudo iwlist wlan0 scan | egrep 'Address|ESSID|Channel'.
  3. Prepare configuration file for wpa_supplicant in /etc/wpa_supplicant folder. You could have more files there with different names. Our file
    will be named wifi.conf.
  4. Adjust the content of the file: replace 00:14:6C:AE:EA:AEmy-wifi and P@ssw0rd with
    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"
    }
  5. Create a script and add execute permissions. Replace my-wifi8 and wifi.conf with
    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
  6. Run the script as root

Armbian hostname and WiFi configuration的更多相关文章

  1. 最简单的RASPBERRY PI wifi配置

    Setting up Wifi with the Command Line  SIMON MONK   This tutorial works best if your router is broad ...

  2. Docker Network Configuration 高级网络配置

    Network Configuration TL;DR When Docker starts, it creates a virtual interface named docker0 on the ...

  3. 树莓派 Zero W——随身钥匙扣

    前言 原创文章,转载引用务必注明链接.水平有限,如有疏漏,欢迎指正. 本文使用Markdown写成,为获得更好的阅读体验和正确的格式显示,请访问我的博客原文: http://www.cnblogs.c ...

  4. 【译】Android 6.0 Changes (机翻加轻微人工校对)

    Android 6.0 Changes In this document Runtime Permissions Doze and App Standby Apache HTTP Client Rem ...

  5. Android M新特性之Behavior Changes

    1.Runtime Permissions On your apps that target the M Preview release or higher, make sure to check f ...

  6. 分布式Hadoop安装(一)

    本文旨在介绍通过两台物理节点,实现完全分布式hadoop程序的部署 writen by Bob Pan@20140609 环境介绍: 主机名 机器IP 用途 描述 Hadoop0 192.168.80 ...

  7. hadoop完全分布式模式的安装和配置

    本文是将三台电脑用路由器搭建本地局域网,系统为centos6.5,已经实验验证,搭建成功. 一.设置静态IP&修改主机名&关闭防火墙(all-root)(对三台电脑都需要进行操作) 0 ...

  8. Hadoop1.1.2伪分布式安装笔记

    一.设置Linux的静态IP 修改桌面图标修改,或者修改配置文件修改 1.先执行ifconfig,得到网络设备的名称eth0 2.编辑/etc/sysconfig/network-scripts/if ...

  9. 智传播客hadoop视频学习笔记(共2天)

    第一天:1.答疑解惑•  就业前景•  学习hadoop要有什么基础•  hadoop会像塞班一样,热一阵子吗•  hadoop学习起来容易还是困难•  课堂上的学习方法(所有实验必须按照要求做,重原 ...

随机推荐

  1. IFC2x3标准阅读

    参考地址:西北逍遥-IFC数据模式架构的四个概念层详解说明 1.架构图 IFC模型体系结构由四个层次构成,从下到上依次是 资源层(Resource Layer).核心层(Core Layer).交互层 ...

  2. HDU-3746 Cyclic Nacklace 字符串匹配 KMP算法 求最小循环节

    题目链接:https://cn.vjudge.net/problem/HDU-3746 题意 给一串珠子,我们可以在珠子的最右端或最左端加一些珠子 问做一条包含循环珠子的项链,最少还需要多少珠子 思路 ...

  3. linux中对socket的理解 socket高并发

    1.socket是什么? 其实准确的来说,socket并不仅仅用于linux而已,它也应用于TCP/IP中.笼统的来说,socket就是指的“IP地址+端口号”.比如我有一个ssh服务器A,这时候我有 ...

  4. C#-CLR各版本特点

    来自为知笔记(Wiz) 附件列表 CLR与NET版本关系.png NET框架工作流程.png VS与CLR关系.png

  5. linux程序设计——个人总结

    linux程序设计--个人总结 到今天为止,<linux程序设计>学习基本完毕了.从五月下旬開始接触linux,学习安装Ubuntu14.04,六月份開始学习<linux程序设计&g ...

  6. 【试水CAS-4.0.3】第02节_CAS服务端登录页个性化

    完整版见https://jadyer.github.io/2015/07/16/sso-cas-login-diy/ /** * @see ------------------------------ ...

  7. 由老同事学习SAP所想到的

    前段时间一位老同事在微信上跟我说他们公司正计划导SAP系统,但整个IT中心几乎无人使用过SAP,知道我在这行业干了多年了,所以想问我怎么开始学习.于是我约他今天出来聊聊,顺便把手里的SAP ECC E ...

  8. C++学习第一天--编译命令

    前一个月的时间主要是在捯饬自己的ubuntu vim环境,昨天终于都搞好了,从今天开始,学习C++.至于为什么学习C++,其实很大一部分原因还是因为自己喜欢vim,又听说vim对C++的支持还不错,所 ...

  9. Excel操作之VLOOKUP

    https://support.office.com/en-us/article/VLOOKUP-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1 Use V ...

  10. MDNS的漏洞报告——mdns的最大问题是允许广域网的mdns单播查询,这会暴露设备信息,或者被利用用于dns放大攻击

    Vulnerability Note VU#550620 Multicast DNS (mDNS) implementations may respond to unicast queries ori ...