找回密码
 -注册-
查看: 5498|回复: 1
打印 上一主题 下一主题

debian 下hqe 、naa网络编方法分享(虚拟网卡完美解决直连naa的ip设置问题)

[复制链接]
跳转到指定楼层
1
发表于 2021-8-15 13:08 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式 来自 广东佛山
本帖最后由 鱼花 于 2021-8-15 17:04 编辑

静态IP
在debian下的hqplayer embedded现打算固定下ip
查看网络情况
  1. ifconfg
复制代码


得知我的网卡名叫:eno1
先备份原有配置文件
  1. cp /etc/network/interfaces /etc/network/interfacesbak
复制代码

可以用nano命令打开配置文件,或xftp 选中文件后右键“用记事本编辑”



原来配置(interfacesbak) 不是执行

  1. # This file describes the network interfaces available on your system
  2. # and how to activate them. For more information, see interfaces(5).

  3. source /etc/network/interfaces.d/*

  4. # The loopback network interface
  5. auto lo
  6. iface lo inet loopback

  7. # The primary network interface
  8. allow-hotplug eno1
  9. iface eno1 inet dhcp
复制代码

需要改为的配置新的interfaces,不是执行
  1. # This file describes the network interfaces available on your system
  2. # and how to activate them. For more information, see interfaces(5).

  3. source /etc/network/interfaces.d/*
  4.      
  5. # The loopback network interface
  6. auto lo
  7. iface lo inet loopback

  8. # The primary network interface
  9. allow-hotplug eno1
  10. iface eno1 inet static
  11. address 192.168.1.177
  12. netmask 255.255.255.0
  13. broadcast 192.168.1.255
  14. gateway 192.168.1.1
复制代码


执行
  1. /etc/init.d/networking restart
  2. ifdowon eno1
复制代码
然后网会断了,得hqe 主机接上键盘,显示器执行
  1. ifup eno1
复制代码








2
 楼主| 发表于 2021-8-15 13:16 | 只看该作者 来自 广东佛山
本帖最后由 鱼花 于 2021-8-15 17:04 编辑

添加虚拟网卡
设成静态,不一定适合所有应用场境,居此添加一虚拟网口,并设为态动就完美解决。这样把hq 主力机拿到2级路由下还可以得到其它ip用。
一楼设静态ip是为直连naa服务的。

在新的配置文件再添加一行
  1. iface eno1:0 inet dhcp
复制代码
需要改为的配置新的interfaces,不是执行
  1. # This file describes the network interfaces available on your system
  2. # and how to activate them. For more information, see interfaces(5).

  3. source /etc/network/interfaces.d/*
  4.      
  5. # The loopback network interface
  6. auto lo
  7. iface lo inet loopback

  8. # The primary network interface
  9. allow-hotplug eno1
  10. iface eno1 inet static
  11. address 192.168.1.177
  12. netmask 255.255.255.0
  13. broadcast 192.168.1.255
  14. gateway 192.168.1.1

  15. iface eno1:0 inet dhcp
复制代码
(注意,就算把虚拟网口设静态也不能设网关的,eno1:0没有gateway)
然后使用ifup eno1:0就可以了。
不要使用/etc/init.d/network restart的方法

  1. ifup eno1:0
复制代码
eno1是我的网卡名,eno1:0新添加的虚拟网卡名。


回复

使用道具 举报

您需要登录后才可以回帖 登录 | -注册-

本版积分规则

Archiver|手机版|粤icp备09046054号|耳机网-耳机大家坛

粤公网安备 44030602000598号 耳机大家坛、www.erji.net、网站LOGO图形均为注册商标

GMT+8, 2025-8-26 12:47

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表