Temat: Zmiana konfiguracji TL-MR3420 na internet po WANie
Używam routera TL-MR3420 v2 (os: OpenWrt 19.07-SNAPSHOT, r11430-ecbbb373ed) w konfiguracji z mobilnym internetem oraz z OpenVPN na pokładzie. Obecnie mam dla niego nowe zadanie (zdalny odczyt danych z interfejsu Modbus poprzez konwerter RS485 <> Ethernet). W tym celu muszę go przekonfigurować, żeby internet dostawał przewodowo po WANie z nadrzędnego routera, który to światłowodem podłączony jest do internetu. Router nadrzędny nie przydzieli mu adresu IP więc będę musiał ustawić statyczny adres IP 10.10.15.40. Obecnie do MR3420 dostaję się poprzez OpenVPN więc mam jedną szansę na przekonfigurowanie całości, jeśli ma to ruszyć za pierwszym razem.
Przeanalizowałem obecną konfigurację (znajduje się poniżej) i moim zdanie będe musiał zmienić:
1. konfigurację interfejsu wan w network:
config interface 'wan'
option device 'eth0'
option proto 'static'
option ipaddr '10.10.15.40'2. wyłączyć maskaradę w firewallu dla zone wan
config zone
option name 'wan'
list network 'wan'
list network 'wan6'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '0'
option mtu_fix '1'3. na routerze nadrzędnym przekierować port, na którym pracuje OpenVPN, na mój router
Czy dobrze to rozumiem i ewentualnie o czymś zapomniałem?
Aktualna konfiguracja:
root@Pila_OpenWrt:~# ifconfig
br-lan Link encap:Ethernet HWaddr C0:4A:00:A2:DF:0C
inet addr:192.168.6.1 Bcast:192.168.6.255 Mask:255.255.255.0
inet6 addr: fd04:b773:627d::1/60 Scope:Global
inet6 addr: fe80::c24a:ff:fea2:df0c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:1254 (1.2 KiB)
eth0 Link encap:Ethernet HWaddr C0:4A:00:A2:DF:0B
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:4
eth1 Link encap:Ethernet HWaddr C0:4A:00:A2:DF:0C
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:5
eth1.1 Link encap:Ethernet HWaddr C0:4A:00:A2:DF:0C
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth2 Link encap:Ethernet HWaddr 00:1E:10:1F:00:00
inet addr:192.168.8.106 Bcast:192.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::21e:10ff:fe1f:0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8422 errors:0 dropped:0 overruns:0 frame:0
TX packets:9438 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1236414 (1.1 MiB) TX bytes:1295736 (1.2 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:40 errors:0 dropped:0 overruns:0 frame:0
TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3651 (3.5 KiB) TX bytes:3651 (3.5 KiB)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.0.1.21 P-t-P:10.0.1.22 Mask:255.255.255.255
inet6 addr: fe80::299e:20ed:4edc:4e83/64 Scope:Link
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:150 errors:0 dropped:0 overruns:0 frame:0
TX packets:168 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:15256 (14.8 KiB) TX bytes:31034 (30.3 KiB)
wlan0 Link encap:Ethernet HWaddr C0:4A:00:A2:DF:0C
inet6 addr: fe80::c24a:ff:fea2:df0c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:2376 (2.3 KiB)root@Pila_OpenWrt:~# uci export network
package 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 'fd04:b773:627d::/48'
config interface 'lan'
option type 'bridge'
option ifname 'eth1.1'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.6.1'
config interface 'wan'
option proto 'dhcp'
option ifname 'eth2'
option dns '8.8.8.8 8.8.4.4'
config interface 'wan6'
option ifname 'eth0'
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 0t'
config interface 'openvpn_tun0'
option ifname 'tun0'
option proto 'none'root@Pila_OpenWrt:~# uci export firewall
package firewall
config defaults
option syn_flood '1'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
config zone
option name 'lan'
list network 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
config zone
option name 'wan'
list network 'wan'
list network 'wan6'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'