openwrt/lede配置單臂路由,centos7開啓vlan支持,小記

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生效。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章