Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

RockpiE/network-management

< RockpiE
Revision as of 03:07, 17 July 2020 by Stephen (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
    ROCK Pi E >  Network Management

This guide describes how to manage the network on ROCK Pi E running Ubuntu/Debian system.

Part 1: Set Ethernet static IP Address

Install some dependency packages

root@rockpie:~# apt-get install netplan.io

Create file, /etc/netplan/01-ethernet.yaml. If there is no /etc/netplan folder, create it.

root@rockpie:~# touch /etc/netplan/01-ethernet.yaml

Add the following contents to the file, /etc/netplan/01-ethernet.yaml and save it.

root@rockpie:~# cat /etc/netplan/01-ethernet.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      addresses:
        - 192.168.42.200/24
      gateway4: 192.168.42.1
      nameservers:
        search:
          - mydomain
          - otherdomain
        addresses:
          - "192.168.42.1"
          - "8.8.8.8"
    eth1:
      addresses:
        - 192.168.1.205/24
      gateway4: 192.168.1.1
      nameservers:
        search:
          - mydomain
          - otherdomain
        addresses:
          - "192.168.1.1"
          - "8.8.8.8"

Run the commands below to apply the changes.

root@rockpie:~# netplan apply

To validate that your changes are apply, run the commands below to view the IP address configuration details.

root@rockpie:~# ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b2:ce:7d:ac:34:13 brd ff:ff:ff:ff:ff:ff
    inet 192.168.42.200/24 brd 192.168.42.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.42.39/24 brd 192.168.42.255 scope global secondary noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::c392:6679:1adc:aa9a/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

root@rockpie:~# ip addr show dev eth1
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b2:ce:7d:ac:34:12 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.205/24 brd 192.168.1.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet 192.168.1.108/24 brd 192.168.1.255 scope global secondary noprefixroute eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::6aa0:d0f7:4298:b441/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

Part 2: Set Wi-Fi static IP Address

root@rockpie:~# cat /etc/netplan/02-wireless.yaml 
network:
  version: 2
  renderer: networkd
  wifis:
    wlan0:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.31.220/24]
      gateway4: 192.168.31.1
      nameservers:
        addresses: [192.168.31.1, 8.8.8.8]
      access-points:
        "rockpi-5g":
          password: "rockpistar"

Run the commands below to apply the changes.

root@rockpie:~# netplan apply

Validate that your changes are apply.

root@rockpie:~# ip addr show dev wlan0
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 7c:a7:b0:0f:e1:b4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.31.220/24 brd 192.168.31.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet 192.168.1.109/24 brd 192.168.1.255 scope global noprefixroute wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::13d9:a11b:7463:40ce/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

Troubleshooting