Router: OpenWrt修改IP地址
查看IP地址
[root@OpenWrt:/]# ifconfig
修改IP地址
[root@OpenWrt:/]# vim /etc/config/network
示例配置
Here an example network UCI subsystem with default settings for a TL-WR1043ND:
config interface 'loopback' option device 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0' config globals 'globals' option ula_prefix 'fd27:70fa:5c1d::/48' config device 'lan_br' option name 'br-lan' option type 'bridge' list ports 'eth0.1' config interface 'lan' option device 'br-lan' option proto 'static' option netmask '255.255.255.0' option ip6assign '60' option ipaddr '192.168.1.1' config interface 'wan' option device 'eth0.2' option proto 'dhcp' config interface 'wan6' option device '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 5t' config switch_vlan option device 'switch0' option vlan '2' option ports '0 5t'
执行重启网卡命令
[root@OpenWrt:/]# service network restart
官方网络设置文档
https://openwrt.org/docs/guide-user/network/network_configuration