OpenWrt虚拟网卡创建语句,一次创建20个

ip link add link eth1 name vth0 type macvlan
ip link add link eth1 name vth1 type macvlan
ip link add link eth1 name vth2 type macvlan
ip link add link eth1 name vth3 type macvlan
ip link add link eth1 name vth4 type macvlan
ip link add link eth1 name vth5 type macvlan
ip link add link eth1 name vth6 type macvlan
ip link add link eth1 name vth7 type macvlan
ip link add link eth1 name vth8 type macvlan
ip link add link eth1 name vth9 type macvlan
ip link add link eth1 name vth10 type macvlan
ip link add link eth1 name vth11 type macvlan
ip link add link eth1 name vth12 type macvlan
ip link add link eth1 name vth13 type macvlan
ip link add link eth1 name vth14 type macvlan
ip link add link eth1 name vth15 type macvlan
ip link add link eth1 name vth16 type macvlan
ip link add link eth1 name vth17 type macvlan
ip link add link eth1 name vth18 type macvlan
ip link add link eth1 name vth19 type macvlan
ip link add link eth1 name vth20 type macvlan

ifconfig vth0 hw ether 92:E8:D0:69:22:C0
ifconfig vth1 hw ether 32:2F:61:11:3B:69
ifconfig vth2 hw ether 96:6F:32:61:0B:F9
ifconfig vth3 hw ether DA:6E:10:26:0F:CB
ifconfig vth4 hw ether A6:B6:58:B3:B5:62
ifconfig vth5 hw ether 06:B1:DD:D7:3B:61
ifconfig vth6 hw ether 46:27:0A:B7:03:F6
ifconfig vth7 hw ether 1A:CE:E9:F7:3C:44
ifconfig vth8  hw ether 9A:CD:ED:F7:3C:44
ifconfig vth9  hw ether 1A:2E:AE:F7:3C:44
ifconfig vth10 hw ether 3A:CE:E9:FB:3C:B4
ifconfig vth11 hw ether 5A:CE:E9:F7:3C:45
ifconfig vth12 hw ether 2A:CE:E6:F7:3C:44
ifconfig vth13 hw ether BA:C6:E9:47:3C:44
ifconfig vth14 hw ether 1A:C2:E9:F7:3C:41
ifconfig vth15 hw ether BA:CE:E9:F7:3C:42
ifconfig vth16 hw ether 06:B1:D1:D7:2B:61
ifconfig vth17 hw ether C6:B1:5D:67:3B:61
ifconfig vth18 hw ether B6:B5:63:D7:32:69
ifconfig vth19 hw ether A6:51:DA:E7:31:21
ifconfig vth20 hw ether D6:B1:BD:D7:3B:61


ifconfig vth0 up
ifconfig vth1 up
ifconfig vth2 up
ifconfig vth3 up
ifconfig vth4 up
ifconfig vth5 up
ifconfig vth6 up
ifconfig vth7 up
ifconfig vth8 up
ifconfig vth9 up
ifconfig vth10 up
ifconfig vth11 up
ifconfig vth12 up
ifconfig vth13 up
ifconfig vth14 up
ifconfig vth15 up
ifconfig vth16 up
ifconfig vth17 up
ifconfig vth18 up
ifconfig vth19 up
ifconfig vth20 up


以上就是20个虚拟网卡的创建语句,MAC地址都不重复,大家感觉不错可以点个关注和收藏哦

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
要在OpenWrt的package目录中创建一个新软件包,可以按照以下步骤操作: 1. 确认OpenWrt的package目录已经被克隆到本地,并且已经更新到最新的版本。可以使用以下命令进行克隆: ``` git clone https://github.com/openwrt/packages.git ``` 2. 进入packages目录,可以看到已经存在的软件包。在该目录下新建一个目录,目录名即为新软件包的名称,例如: ``` cd packages mkdir mypackage ``` 3. 进入新建的目录,创建一个Makefile文件,该文件描述了软件包的编译和安装规则等信息。可以使用以下命令创建Makefile文件: ``` cd mypackage touch Makefile ``` 4. 编辑Makefile文件,根据新软件包的特点填写相关信息,例如: ``` include $(TOPDIR)/rules.mk PKG_NAME:=mypackage PKG_VERSION:=1.0 PKG_RELEASE:=1 PKG_SOURCE_URL:=http://www.example.com/ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz include $(INCLUDE_DIR)/package.mk define Package/mypackage SECTION:=utils CATEGORY:=Utilities TITLE:=My Package DEPENDS:=+libpthread endef define Package/mypackage/description This is my package description. endef define Build/Prepare mkdir -p $(PKG_BUILD_DIR) $(CP) ./src/* $(PKG_BUILD_DIR)/ endef define Package/mypackage/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/mypackage $(1)/usr/bin/ endef $(eval $(call BuildPackage,mypackage)) ``` 5. 保存Makefile文件,并且在packages目录下运行make menuconfig命令,可以在菜单中看到新软件包的名称,勾选该软件包并保存配置。 6. 运行make命令进行编译,编译成功后可以在bin目录下看到新软件包的ipk文件。 7. 将ipk文件上传到路由器上,并且使用opkg命令进行安装,例如: ``` opkg install mypackage_1.0-1.ipk ``` 8. 安装完成后,在路由器上运行新软件包,例如: ``` mypackage ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

穗余

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值