Welcome to the computer world of Raspberry!
OS installation
Get the image from its offical website and extract it into the SD card by using the command 7za x file.zip
. On Linux, dd
is the image writing tool:
1 | dd bs=4M if=2019-07-10-raspbian-buster.img of=/dev/sdX status=progress conv=fsync |
For Pi3, there exists wireless card, so use sudo raspi-config
to enable it.
change source list:
https://mirror.tuna.tsinghua.edu.cn/help/raspbian/
Enable WiFi network
1 | sudo apt install raspberry-headers |
Share network to RPi by ethernet
1 | [root@inspiron-7537 shane]# iptables -S |
Then use arp
we will find the address:
1 | [root@inspiron-7537 shane]# arp |
The IP of Pi is 192.168.137.244
.
Config on Host Linux computer
First three commands
1 | iptables -t nat -A POSTROUTING -o wlp2s0 -j MASQUERADE |
If the first iptables is wrong, that’s because this arch has just upgraded its kernel so it needs reboot. But if it’s the problem of nat you might
1 | sudo modprobe ip_tables |
Second three commands
1 | iptables -I INPUT -p udp --dport 67 -i enp3s0f1 -j ACCEPT |
Now it should be ok.
But sometimes we may face the problem of cannot connect to the wifi web. This is because the ip route takes ethernet as the default gateway. Check by ip route
.
Then delete one: sudo route del default gw 192.168.137.1 enp3s0f1
RPi serving as NAS
turn on root
1 | apt install samba |
Edit /etc/fstab
1 | /dev/sda1 /mnt/ext4 ext4 defaults 0 0 |
samba conf
For example
1 | [linux-share] |
Mount from Windows
我的电脑 > 右键”计算机” > 添加一个网络位置
Mounf from Linux
an example from /etc/fstab
1 | //rpi4/win-share /mnt/hard-disk-ntfs cifs _netdev,username=pi,password=shallwetalk,iocharset=utf8,uid=wsd,gid=wsd 0 0 |
离线下载
Install aria2c and webui-aria2
Comments
shortname
for Disqus. Please set it in_config.yml
.