openwrt/lede配置单臂路由,centos7开启vlan支持,小记

来源:互联网 发布:最新淘宝好评返现违规 编辑:程序博客网 时间:2024/05/21 17:41

1,lede单臂路由配置,vi /etc/config/network,

添加如下内容

  1. config switch_vlan  
  2.           option device eth0  
  3.           option vlan 0  
  4.           option ports "1 2" 
修改interface lan的ifname为eth0.1,interface wan和wan6的ifname为eth0.2

保存后重启生效。

2,配置centos7 vlan支持,vlan id 假定为1

modprobe 8021q

cd /etc/sysconfig/network-scripts/

cp ifcfg-enp0s3 ifcfg-enp0s3.1

vi ifcfg-enp0s3,修改BOOTPROTO=none

vi ifcfg-enp0s3.1,删除TYPE=Ethernet,添加VLAN=yes,修改DEVICE=enp0s3.1

保存后systemctl restart network生效。

原创粉丝点击