openwrt 中route配置

route配置项默认保存在文件 /etc/config/network 中。

配置route的接口“interface” 使用的协议需要为dhcp才可。

config interface 'wan'

     option ifname 'eth0.2'

      option proto  'dhcp'

       .......

config route  
       option interface 'wan'      
   option target '192.168.2.202'
       option netmask '255.255.255.0'
       option gateway '192.168.2.1'
       option metric '2'
        option mtu '1500' 

原文地址:https://www.cnblogs.com/rohens-hbg/p/6376767.html