At the moment IP. In my openvpn config file I have something like this:
list remote '12.123.123.123 80'
But I'm thinking about switching to NordVPN next month and I think they use hostname.
These two rules that guy in the other thread used are equivalent to what you told me to do or is it something else entirely?
ip route add default via 192.168.0.1 table 10
ip rule add from 192.168.5.2 table 10
Something to occurred to me. Does it matter that the OpenWrt router is connected to my ISP modem/router which is configured in bridge mode (to avoid double NAT)?
I reading all I can find on routes to actually understand what in happening with all those rules/routes and actually be able to troubleshoot this situation. If there is any material you recommend let me know.
Yes, those commands are similar (default = 0.0.0.0/0). You enter those commands at the system prompt when not using the UCI/web GUI. Please be advised, it's just one route, and one routing rule. You keep mixing terms.
It shouldn't. You should be getting a public IP from the modem.
After studying the material @lleachii recommend and doing some more research I ended up finding another thread about the same thing, which had the solution.
I added the following to Network > Firewall > Custom Rules
ip route add 192.168.1.0/24 dev br-lan table lan
ip route add default via xxx.xx.192.1 src 100.64.196.32 table lan
ip route add 192.168.10.0/24 dev br-lan2 table vpn
ip route add default via xx.xx.0.102 src xx.xx.0.101 table vpn
ip rule add from 192.168.10.0/24 to default lookup vpn prio 16000
ip rule add from 192.168.1.0/24 to default lookup lan prio 16010
ip rule add iif lo to default lookup lan prio 16020
Added vpn and lan tables to /etc/iproute2/rt_tables
#
# reserved values
#
128 prelocal
255 local
254 main
253 default
250 vpn
240 lan
0 unspec
#
# local
#
#1 inr.ruhep
config defaults
option syn_flood '1'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option network 'lan'
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
option network 'wan wan6'
config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'
config rule
option name 'Allow-Ping'
option src 'wan'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-IGMP'
option src 'wan'
option proto 'igmp'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-DHCPv6'
option src 'wan'
option proto 'udp'
option src_ip 'fc00::/6'
option dest_ip 'fc00::/6'
option dest_port '546'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-MLD'
option src 'wan'
option proto 'icmp'
option src_ip 'fe80::/10'
list icmp_type '130/0'
list icmp_type '131/0'
list icmp_type '132/0'
list icmp_type '143/0'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Input'
option src 'wan'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
list icmp_type 'router-solicitation'
list icmp_type 'neighbour-solicitation'
list icmp_type 'router-advertisement'
list icmp_type 'neighbour-advertisement'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Forward'
option src 'wan'
option dest '*'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-IPSec-ESP'
option src 'wan'
option dest 'lan'
option proto 'esp'
option target 'ACCEPT'
config rule
option name 'Allow-ISAKMP'
option src 'wan'
option dest 'lan'
option dest_port '500'
option proto 'udp'
option target 'ACCEPT'
config include
option path '/etc/firewall.user'
config zone
option name 'vpnclient'
option network 'vpn'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
config zone
option name 'lan2'
option input 'REJECT'
option forward 'REJECT'
option output 'ACCEPT'
option network 'lan2'
config forwarding
option dest 'wan'
option src 'lan'
config forwarding
option dest 'vpnclient'
option src 'lan2'
PS1: For some reason DHCP on LAN2 isn't working, it's not a issue to me, but be aware of it in case you copy the configs. PS2: I can't ping from one LAN to the other. Tried adding the forwarding rules without success.
Still, you are rejecting INPUT from zone LAN2, so the DHCP packets from the hosts in LAN2 will never reach the router, as you don't specifically allow port 67.
I had a closer look in the rules you added. Since you want to have intra-LAN traffic, you must add a route for the other network in the new routing tables. Otherwise packets to the other LAN go to the internet gateway.
ip route add 192.168.10.0/24 dev br-lan2 table lan
ip route add 192.168.1.0/24 dev br-lan table vpn
By adding these two rules I can ping between LANs! Edit: I just notice that I got really weird ping timings
➜ ~ ping 192.168.10.172
PING 192.168.10.172 (192.168.10.172) 56(84) bytes of data.
64 bytes from 192.168.10.172: icmp_seq=1 ttl=63 time=4.01 ms
64 bytes from 192.168.10.172: icmp_seq=2 ttl=63 time=5.81 ms
64 bytes from 192.168.10.172: icmp_seq=3 ttl=63 time=3.44 ms
64 bytes from 192.168.10.172: icmp_seq=4 ttl=63 time=80.10 ms
64 bytes from 192.168.10.172: icmp_seq=5 ttl=63 time=105 ms
64 bytes from 192.168.10.172: icmp_seq=6 ttl=63 time=129 ms
64 bytes from 192.168.10.172: icmp_seq=7 ttl=63 time=153 ms
64 bytes from 192.168.10.172: icmp_seq=8 ttl=63 time=173 ms
64 bytes from 192.168.10.172: icmp_seq=9 ttl=63 time=196 ms
64 bytes from 192.168.10.172: icmp_seq=10 ttl=63 time=48.8 ms
64 bytes from 192.168.10.172: icmp_seq=11 ttl=63 time=41.2 ms
64 bytes from 192.168.10.172: icmp_seq=12 ttl=63 time=675 ms
64 bytes from 192.168.10.172: icmp_seq=13 ttl=63 time=5.50 ms
64 bytes from 192.168.10.172: icmp_seq=14 ttl=63 time=412 ms
64 bytes from 192.168.10.172: icmp_seq=15 ttl=63 time=950 ms
64 bytes from 192.168.10.172: icmp_seq=16 ttl=63 time=7.11 ms
^C
--- 192.168.10.172 ping statistics ---
16 packets transmitted, 16 received, 0% packet loss, time 31ms
rtt min/avg/max/mdev = 3.438/186.983/950.424/262.211 ms
That's way to much for just going to the router and back.
(I'm pinging from a cabled connection on LAN to my phone on LAN2 wifi)
By allowing INPUT and FORWARD in zone lan2 DCHP works, however I get a DNS leak.
I tried setting the VPN DNS in Network > Interfaces > LAN2 > Common Configuration > Use custom DNS servers and in Network > Interfaces > LAN2 > DHCP Server > Advanced Settings > DHCP-Options but I still get the leak.
Setting manual IP and rejecting INPUT/FORWARD in zone lan2 allows ping between LANs (because of those two routes) and I don't get leaks.
I'm just not sure there will be any undesired behaviours because of the reject (besides DCHP not working).