|
本帖最后由 weereew 于 2012-3-22 18:22 编辑
固件版本:trunk r30919(经测试,只适用于r30919,在r30857上测试不成功)
所需软件:kmod-macvlan,ip
均来自openwrt官网源
在我仅有的环境下,lan和wan自适应:插到上层路由器上可自动获得ip地址,插到电脑上以后电脑也可以自动获得ip地址,有兴趣的可以测试一下
配置文件如下:
/etc/rc.local
- # Put your custom commands here that should be executed once
- # the system init finished. By default this file does nothing.
- ip link add link eth0 eth2 type macvlan
- ifconfig eth2 hw ether 00:11:22:33:44:5b
- ifconfig eth2 up
- exit 0
复制代码 /etc/config/network
- config 'interface' 'loopback'
- option 'ifname' 'lo'
- option 'proto' 'static'
- option 'ipaddr' '127.0.0.1'
- option 'netmask' '255.0.0.0'
- config 'interface' 'lan'
- option ifname 'eth2'
- option 'type' 'bridge'
- option 'proto' 'static'
- option 'ipaddr' '192.168.18.1'
- option 'netmask' '255.255.255.0'
- config 'interface' 'wan'
- option 'proto' 'dhcp'
- option 'ifname' 'eth0'
- option 'hostname' 'openwrt'
复制代码
wireless文件不需要配置
|
|