耳机网-耳机大家坛
标题:
debian 下hqe 、naa网络编方法分享(虚拟网卡完美解决直连naa的ip设置问题)
[打印本页]
作者:
鱼花
时间:
2021-8-15 13:08
标题:
debian 下hqe 、naa网络编方法分享(虚拟网卡完美解决直连naa的ip设置问题)
本帖最后由 鱼花 于 2021-8-15 17:04 编辑
静态IP
在debian下的hqplayer embedded现打算固定下ip
查看网络情况
ifconfg
复制代码
得知我的网卡名叫:eno1
先备份原有配置文件
cp /etc/network/interfaces /etc/network/interfacesbak
复制代码
可以用nano命令打开配置文件,或xftp 选中文件后右键“用记事本编辑”
原来配置(
interfacesbak) 不是执行
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eno1
iface eno1 inet dhcp
复制代码
需要改为的配置新的
interfaces,不是执行
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eno1
iface eno1 inet static
address 192.168.1.177
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
复制代码
执行
/etc/init.d/networking restart
ifdowon eno1
复制代码
然后网会断了,得hqe 主机接上键盘,显示器执行
ifup eno1
复制代码
作者:
鱼花
时间:
2021-8-15 13:16
本帖最后由 鱼花 于 2021-8-15 17:04 编辑
添加虚拟网卡
设成静态,不一定适合所有应用场境,居此添加一虚拟网口,并设为态动就完美解决。这样把hq 主力机拿到2级路由下还可以得到其它ip用。
一楼设静态ip是为直连naa服务的。
在新的配置文件再添加一行
iface eno1:0 inet dhcp
复制代码
需要改为的配置新的
interfaces,不是执行
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eno1
iface eno1 inet static
address 192.168.1.177
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
iface eno1:0 inet dhcp
复制代码
(注意,就算把虚拟网口设静态也不能设网关的,eno1:0没有gateway)
然后使用ifup eno1:0就可以了。
不要使用/etc/init.d/network restart的方法
ifup eno1:0
复制代码
eno1是我的网卡名,eno1:0新添加的虚拟网卡名。
欢迎光临 耳机网-耳机大家坛 (http://erji.net/)
Powered by Discuz! X3.2