Hello! I have gotten my port forwarding to work properly for external users, but when trying to connect via internal network, I am only able to connect via internal IP (not sufficient for this game service & requirements). I have enabled NAT Loopback and 'use Internal IP address' is selected.
I have done quite a bit of research if I should use internal or external IP here. No concise answer.
I also don't know if this NAT loopback makes sense to be on this rule, or if it should be a new rule specific for loopback.
cat /etc/config/firewall
config defaults
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
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 output 'ACCEPT'
option masq '1'
option mtu_fix '1'
option input 'REJECT'
option forward 'REJECT'
config forwarding
option src 'lan'
option dest 'wan'
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 zone 'docker'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option name 'docker'
list network 'docker'
config redirect
option dest 'lan'
option target 'DNAT'
option name 'Ark Game1'
option src 'wan'
list proto 'tcp'
list proto 'udp'
option dest_ip '192.168.1.106'
option src_dport '7777'
option dest_port '7777'
config redirect
option dest 'lan'
option target 'DNAT'
option name 'Ark1 Peer'
option src 'wan'
list proto 'tcp'
list proto 'udp'
option dest_ip '192.168.1.106'
option src_dport '7778'
option dest_port '7778'
config redirect
option dest 'lan'
option target 'DNAT'
option src 'wan'
list proto 'tcp'
list proto 'udp'
option dest_ip '192.168.1.106'
option src_dport '27015-27024'
option dest_port '27015-27024'
option name 'Ark1&2 Query'
config redirect
option dest 'lan'
option target 'DNAT'
option name 'Ark1 RCON'
option src 'wan'
option src_dport '32330'
option dest_port '32330'
list proto 'tcp'
list proto 'udp'
option dest_ip '192.168.1.106'
config redirect
option dest 'lan'
option target 'DNAT'
option name 'ArkGame2'
option src 'wan'
option dest_ip '192.168.1.106'
option src_dport '7779'
option dest_port '7779'
config redirect
option dest 'lan'
option target 'DNAT'
option name 'Ark Peer2'
option src 'wan'
option dest_ip '192.168.1.106'
option src_dport '7780'
option dest_port '7780'
config redirect
option dest 'lan'
option target 'DNAT'
option name 'ark2 rcon'
option src 'wan'
option src_dport '32331'
option dest_ip '192.168.1.106'
option dest_port '32331'
config redirect
option dest 'lan'
option target 'DNAT'
option src 'wan'
option src_dport '27016'
option dest_ip '192.168.1.106'
option dest_port '27016'
option src_ip '192.168.1.1/24'
option name 'loopback Ark2'
option enabled '0'
config redirect
option dest 'lan'
option target 'DNAT'
option name 'loopback ark1'
option src 'wan'
option src_ip '192.168.1.1/24'
option src_dport '27015'
option dest_ip '192.168.1.106'
option dest_port '27015'
option enabled '0'
config redirect
option dest 'lan'
option target 'DNAT'
option name 'Ark2 Querry'
option src 'wan'
option dest_ip '192.168.1.106'
option src_dport '27023'
option dest_port '27023'
option reflection_src 'external'
option enabled '0'
config redirect
option dest 'lan'
option target 'DNAT'
option src 'lan'
option dest_ip '192.168.1.106'
option name 'T-PC loopback'
option reflection_src 'external'
option src_dport '27015-27016'
option dest_port '27015-27016'
option src_ip '169.254.79.179'
option enabled '0'
config redirect
option dest 'lan'
option target 'DNAT'
option name 'T-PC loopback gameports'
option src 'lan'
option src_dport '7777-7780'
option dest_ip '192.168.1.106'
option dest_port '7777-7780'
option src_ip '169.254.79.179'
option reflection_src 'external'
option enabled '0'
config redirect
option dest 'wan'
option target 'DNAT'
option name 'lan to wan?'
option src 'lan'
option src_ip '169.254.79.179'
option src_dport '27015-27016'
option dest_ip 'EXTERNALIP'
option dest_port '27015-27016'
option enabled '0'
cat /etc/config/network
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 'fd00:ab:cd::/48'
config device
option name 'eth0'
option macaddr 'MACADD'
config interface 'wan'
option device 'eth0'
option proto 'dhcp'
config interface 'wan6'
option device 'eth0'
option proto 'dhcpv6'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth1'
config device
option name 'eth1'
option macaddr 'MACADD'
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 'docker'
option device 'docker0'
option proto 'none'
option auto '0'
config device
option type 'bridge'
option name 'docker0'
a rule that allows the traffic and places the packet in the SRC network . This changes the DST IP from the Public to the LAN, and allows the packet to travel using the zones regular routing rules.
The query port for the server is 27015, and the game port(s) are 7777 and 7778. These rules don't look the same as yours, but I believe they are the same. Let me know what you think, and if I made any errors.
You would simply address the server at 192.166.1.106 (i.e no routing); or since you say that's impossible
Yea, that makes sense. I thought the rule might force it to route thru WAN back to my LAN.
Place in another VLAN, then a rule that requires routing will work; or
How would I accomplish this? Make a new Interface in OpenWRT?
Add a DNS name on the OpenWrt for the server with the LAN IP
This is something I tried to research but couldn't understand. Is it something that OpenWRT can do itself, or do I need to figure out how to host something on one of my PCs to act as DNS? I did this but have no idea how to use it, or if it's helpful:
Yes I am. I have it set on many servers, Public IPs, etc.
I provided you the information. You should try that.
I also provided you information that "Loopback" check mark works for the IP in the rule in question only (e.g. an HTTP server on a desktop PC and you test with the Public IP); but you're tying to redirect traffic.
Again, you cannot route in the same LAN/VLAN, the Kernel and clients are smart enough to know the SRC (source) and DST (destination) network are identical (i.e. no need to use router/gateway/firewall). So to redirect, you have to cross a network.