openwrt 1407改IP

在trunk文件夹下运行

mkdir -p files/etc/config

然后在 config 文件夹下新建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 'fd3b:272f:a046::/48'

config interface 'lan'
	option ifname 'eth0.1'
	option force_link '1'
	option macaddr '7a:20:00:02:5f:74'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.20.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config interface 'wan'
	option ifname 'eth0.2'
	option force_link '1'
	option macaddr '7a:20:00:02:5f:75'
	option proto 'dhcp'

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

config interface 'ppp0'
	option ifname 'ppp0'
	option service 'evdo'
	option username 'card'
	option password 'card'
	option device '/dev/ttyUSB0'
	option proto '3g'
	option dialnumber '#777'
	option apn 'ctnet'
	option ipv6 'auto'

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

config switch_vlan
	option device 'rt305x'
	option vlan '1'
	option ports '0 1 2 3 6t'

config switch_vlan
	option device 'rt305x'
	option vlan '2'
	option ports '4 6t'
network 内容可依据需求更改内容。

原理是  make 后 files/etc/config/network 会覆盖开发板的 network 文件

转载于:https://www.cnblogs.com/ljbguanli/p/6902710.html

你可能感兴趣的:(openwrt 1407改IP)