In this document I will document network interfaces configurations
x:add("config", "net")
x:set("network", "lime_app_eth_cfg_eth0.1", "net") --wont work because of the dot in the tag
```
ubus call lime-utils get_node_status '{}'
{
"ips": [
{
"version": "4",
"address": "10.234.74.214/16"
},
{
"version": "6",
"address": "fdea:d2c9:33bf::22:4ad6/64"
},
{
"version": "6",
"address": "fe80::aa40:41ff:fe22:4ad7/64"
}
],
"hostname": "LiMe-224ad6",
"switch_status": [
{
"device": "eth0.1",
"num": 5,
"role": "wan",
"link": "down"
},
{
"device": "eth0.1",
"num": 0,
"role": "cpu",
"link": "up"
},
{
"device": "eth1.2",
"num": 4,
"role": "lan",
"link": "up"
},
{
"device": "eth1.2",
"num": 6,
"role": "cpu",
"link": "up"
}
],
```
in librerouter1 the default lime-autogen relevant contents are ...
```
config lime 'network'
option bmx6_publish_ownip 'false'
option bmx6_wifi_rate_max '54000000'
option main_ipv4_address '10.%N1.0.0/16'
list resolvers '4.2.2.2'
list resolvers '141.1.1.1'
list resolvers '2001:470:20::2'
option bmx6_mtu '1500'
option bmx7_pref_gw 'none'
option batadv_orig_interval '2000'
option bmx6_pref_gw 'none'
option main_ipv6_address 'fd%N1:%N2%N3:%N4%N5::/64'
option use_odhcpd 'false'
option bmx6_over_batman 'false'
option anygw_mac 'aa:aa:aa:%N1:%N2:aa'
option primary_interface 'eth0'
option bmx7_enable_pki 'false'
option batadv_routing_algo 'BATMAN_IV'
option bmx7_publish_ownip 'false'
option anygw_dhcp_limit '0'
option bmx7_mtu '1500'
option bmx7_wifi_rate_max 'auto'
list protocols 'ieee80211s'
list protocols 'lan'
list protocols 'anygw'
list protocols 'batadv:%N1'
list protocols 'bmx6:13'
list protocols 'olsr:14'
list protocols 'olsr6:15'
list protocols 'olsr2:16'
list protocols 'babeld:17'
list protocols 'bmx7:18'
option anygw_dhcp_start '2'
option bmx7_over_batman 'false'
config net 'lm_hwd_openwrt_wan'
option autogenerated 'true'
list protocols 'ieee80211s'
list protocols 'anygw'
list protocols 'batadv:%N1'
list protocols 'bmx6:0'
list protocols 'olsr:14'
list protocols 'olsr6:15'
list protocols 'olsr2:16'
list protocols 'babeld:17'
list protocols 'bmx7:0'
list protocols 'wan'
option linux_name 'eth0.1'
```
suponinendo el caso de que quiera convertir eth0.1 en lan en lugar de wan
lan-mesh-wan -default para borrar la config especifica
```
config net 'lime_app_eth_cfg_eth0.1'
option linux_name 'eth0.1'
list protocols 'lan'
config net lm_hwd_openwrt_wan #https://foro.librerouter.org/t/como-conectar-el-librerouter-como-cliente-wifi/158
option autogenerated 'false'
```
If the LibreMesh package lime-hwd-openwrt-wan is installed and your node have two or more ethernet ports,
LibreMesh might autoconfigure as WAN one of these network ethernet device.
In this case you will find a new specific configuration section like this one:
config net 'lm_hwd_openwrt_wan'
option autogenerated 'true'
...
If we want to change the behavior of this specific network interface and stop the automatic rewrite of its configuration, we must set the autogenerated option to false.
suponiendo el caso en que cambio el ethernet de lan a wan ...
```
config net manual_eth1.2_wan
option linux_name 'eth1.2'
list protocols 'wan'
list protocols 'static' # Set up a static IP (both IPv4 and IPv6 supported)
option static_ipv4 '192.168.126.187/24'
option static_gateway_ipv4 '192.168.126.254' # in static protocol, specifying an IP for the gateway is optional. Skip this line if no default route should be added on this interface.
```
/etc/init.d/network reload
tiene el efecto deseado perooo
```
valid_lft forever preferred_lft forever
10: eth1_17@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1496 qdisc noqueue state UP qlen 1000
link/ether a8:40:41:22:4a:d7 brd ff:ff:ff:ff:ff:ff
inet 10.234.74.214/32 brd 255.255.255.255 scope global eth1_17
valid_lft forever preferred_lft forever
inet6 fe80::aa40:41ff:fe22:4ad7/64 scope link
valid_lft forever preferred_lft forever
11: eth1_250@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1496 qdisc noqueue master bat0 state UP qlen 1000
link/ether 02:bb:ed:22:4a:d6 brd ff:ff:ff:ff:ff:ff
inet6 fe80::bb:edff:fe22:4ad6/64 scope link
valid_lft forever preferred_lft forever
12: eth1.2@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether a8:40:41:22:4a:d7 brd ff:ff:ff:ff:ff:ff
inet 192.168.126.187/24 brd 192.168.126.255 scope global eth1.2
valid_lft forever preferred_lft forever
inet6 fe80::aa40:41ff:fe22:4ad7/64 scope link
valid_lft forever preferred_lft forever
13: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether 4a:dc:2f:f6:79:60 brd ff:ff:ff:ff:ff:ff
inet 10.234.74.214/16 brd 10.234.255.255 scope global br-lan
valid_lft forever preferred_lft forever
inet6 fdea:d2c9:33bf::22:4ad6/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::48dc:2fff:fef6:7960/64 scope link
valid_lft forever preferred_lft forever
ubus call lime-utils get_node_status '{}'
{
"ips": [
{
"version": "4",
"address": "10.234.74.214/16"
},
{
"version": "6",
"address": "fdea:d2c9:33bf::22:4ad6/64"
},
{
"version": "6",
"address": "fe80::48dc:2fff:fef6:7960/64"
}
],
"hostname": "LiMe-224ad6",
"switch_status": [
{
"device": "eth0.1",
"num": 5,
"role": "wan",
"link": "down"
},
{
"device": "eth0.1",
"num": 0,
"role": "cpu",
"link": "up"
},
{
"device": "eth1.2",
"num": 4,
"role": "lan",
"link": "up"
},
{
"device": "eth1.2",
"num": 6,
"role": "cpu",
"link": "up"
}
],
```
sigue mostrandolo como lan en lugar de wan ... pero esta ruteando correctamente y funciona como wan el puerto que antes era lan
si agrego la opcion de la lan ... no entrega ips. parece que falta que funcione el servidor de dhcp
```
ubus call lime-utils get_node_status '{}'
{
"ips": [
{
"version": "4",
"address": "10.234.74.214/16"
},
{
"version": "6",
"address": "fdea:d2c9:33bf::22:4ad6/64"
},
{
"version": "6",
"address": "fe80::3ce2:70ff:fed8:4a21/64"
}
],
"hostname": "LiMe-224ad6",
"switch_status": [
{
"device": "eth0.1",
"num": 5,
"role": "wan",
"link": "up"
},
{
"device": "eth0.1",
"num": 0,
"role": "cpu",
"link": "up"
},
{
"device": "eth1.2",
"num": 4,
"role": "lan",
"link": "up"
},
{
"device": "eth1.2",
"num": 6,
"role": "cpu",
"link": "up"
}
],
"status": "ok",
"uptime": "160.97",
"most_active": {
}
}
root@LiMe-224ad6:~# cat /etc/config/lime-
lime-app lime-autogen lime-community lime-defaults lime-node
root@LiMe-224ad6:~# cat /etc/config/lime-node
config lime 'system'
option hostname 'LiMe-224ad6'
# option firstbootwizard_configured 'true'
config net
option linux_name 'eth0.1'
list protocols 'lan'
config net
option linux_name 'eth1.2'
list protocols 'wan'
list protocols 'static' # Set up a static IP (both IPv4 and IPv6 supported)
option static_ipv4 '192.168.126.187/24'
option static_gateway_ipv4 '192.168.126.254' # in static protocol, specifying an IP for the gateway is optional. Skip this line if no default route should be added on this interface.
root@LiMe-224ad6:~#
```
## Api definitions
ubus call lime-utils get_eth_config '{}'
ubus call lime-utils set_eth_config '{"device": "eth0.1","role": "wan"}'