当前位置: 首页 > news >正文

Fine3399或rk3399\sw799刷armbian创建热点

sudo bash
#切换root
sudo apt install -y hostapd isc-dhcp-server ifupdown# 配置 hostapd
sudo nano /etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
ssid=hostspot-name
macaddr_acl=0
auth_algs=1
#auth_algs=3
ignore_broadcast_ssid=0
hw_mode=g
channel=6
wpa=2
wpa_passphrase=password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
#wpa_pairwise=TKIP
#rsn_pairwise=CCMP# 修改 hostapd 默认配置文件路径
sudo nano /etc/default/hostapd
DAEMON_CONF=/etc/hostapd/hostapd.conf# 重启 hostapd
sudo service hostapd restart
sudo service hostapd status# dhcp 配置
sudo nano /etc/dhcp/dhcp.conf
#option domain-name "example.org";
#option domain-name-servers ns1.example.org, ns2.example.org;
authoritative;
subnet 10.0.0.0 netmask 255.255.255.0 {range 10.0.0.10 10.0.0.200;option broadcast-address 10.0.0.255;option routers 10.0.0.1;default-lease-time 600;max-lease-time 7200;option domain-name "local";option domain-name-servers 223.5.5.5, 8.8.4.4;
}# 设置 dhcp 网口
# 不进行操作会出现错误:Not configured to listen on any interfaces!
sudo nano /etc/default/isc-dhcp-server
INTERFACESv4="wlan0"
INTERFACESv6="wlan0"# 设置 wlan0 地址
# 不进行操作会出现错误:Not configured to listen on any interfaces!
sudo ip addr add 10.0.0.1/24 dev wlan0
# 设置开机自动设置
mkdir /etc/network/interfaces.d/
echo -e "# armbian NAT hostapd\nallow-hotplug wlan0\niface wlan0 inet static \taddress 10.0.0.1\n\tnetmask 255.255.255.0\n\tnetwork 10.0.0.0\n\tbroadcast 10.0.0.255" > /etc/network/interfaces.d/armbian.ap.nat
# 开启转发
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -s 10.0.0.1/24 -o eth0 -j MASQUERADE
#设置开机启动自动设置
iptables-save > /etc/iptables.ipv4.nat
cat <<-EOF > /etc/systemd/system/armbian-restore-iptables.service
[Unit]
Description="Restore IP tables"
[Timer]
OnBootSec=20Sec
[Service]
Type=oneshot
ExecStart=/sbin/iptables-restore /etc/iptables.ipv4.nat
[Install]
WantedBy=sysinit.target
EOF
systemctl enable armbian-restore-iptables.service
# 启动 dhcp 服务
systemctl enable isc-dhcp-server 
systemctl start isc-dhcp-server 

参考:https://gitee.com/xiayang0521/rk3399


http://www.mrgr.cn/news/19923.html

相关文章:

  • 地平线Sparse4D论文解析(含论文原文)
  • 安全检查报告模板
  • 你必须知道的C语言问题(8)
  • 赶紧码住!8款AI智能论文生成系统,毕业论文编写不难!
  • 基于RT的服务健康状况探测的时间间隔选择问题
  • Spring1~~~
  • 2024 年 Python 学习路线推荐,附学习书籍,学习视频(建议收藏)
  • turbovnc 服务端、客户端安装
  • 2024.9.4
  • 火狐浏览器设置秘籍:让https协议下的ws不加密时运行无阻(WebSocket connection HTTPS)
  • 【Java】ApiPost请求返回 `406` 状态码(jackson)
  • STM32 SPI
  • 【电感】基础知识
  • 35.搜索插入位置
  • JSON Hero:视图查看更简单!!【送源码】
  • 【高等代数笔记】(18)N阶行列式
  • Linux教程8:文本编辑命令vi
  • 【JAVA】第三天
  • Java-互斥锁死锁释放锁
  • Leetcode—72. 编辑距离【中等】