OpenWRT配置 -- 网络配置network文件

硬件环境 :MT7628AN

OpenWRT 中 WAN 和 LAN 的配置在 /etc/config/network 文件中,下面是目前自己使用的 network 文件内容,留个笔记以备后续使用。

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config globals 'globals'
    option ula_prefix 'fd25:13a3:0506::/48'

config interface 'lan'
    option type 'bridge'
    option ifname 'eth0.1'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option ip6assign '60'

config device 'lan_dev'
    option name 'eth0.1'
    option macaddr 'ce:c1:e7:69:cc:2f'

config interface 'wan'
    option ifname 'eth0.2'
    option proto 'dhcp'

config device 'wan_dev'
    option name 'eth0.2'
    option macaddr 'ce:c1:e7:69:cc:30'

config interface 'wan6'
    option ifname 'eth0.2'
    option proto 'dhcpv6'

config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'switch0'
    option vlan '1'
    option ports '1 2 3 4 6t'

config switch_vlan
    option device 'switch0'
    option vlan '2'
    option ports '0 6t'

猜你喜欢

转载自blog.csdn.net/zhemingbuhao/article/details/102725818
今日推荐