Yota
Very Senior Member
Forgive me, I am a newbie to iptables. I have tried to do this all week alone, but I can't so I need a help.
I have a custom interface
Here is what I did:
Allow access to the router:
Allow access to the internet:
Allow access to my home subnet
What I did successfully:
Any device under the custom interface can
Any device under the custom interface can use 8.8.8.8 DNS or other public DNS.
Without using NAT rules, custom interface using public DNS can access the Internet normally.
Needs I can't achieve:
None of the devices under the custom interface can use the router's 192.168.50.1 as the DNS server, and there is no response.
But I can use other DNS servers in my home subnet, such as 192.168.50.2 (hosted by another router). This proves that the custom interface can normally access my home subnet.
I used the command below to intercept DNS requests to my router, but after using it, I still did not get any DNS response.
I just found that there is a DNS server on my VPN interface, so I tried to use the NAT command below to reset the DNS request to the VPN client. This command works normally. But I hope that DNS requests through the router.
This confirms that the syntax of the command is correct, but I can't make it working for my router DNS server.
The current state is
The custom interface:
Can access Internal: OK
Can ping the router and vice versa: OK
Can access Internet: OK
Can get public DNS response: OK
Can get the DNS response from the router: NO
So, what should I do so that the custom interface can get the router's DNS response?
Background Information:
I enabled DNS over TLS, And the DNSFilter is enabled (it has been tested to close the DNSFilter is still not working)
My router's RT-AC86U runs 386.2_4 firmware.
I will restart the firewall after each test, so there is no iptables rule conflict.
I have a custom interface
ci01
that was created by another program. I now need this interface to get the DNS response from the router.Here is what I did:
Allow access to the router:
Code:
iptables -I INPUT -i ci+ -j ACCEPT
Allow access to the internet:
Code:
iptables -I FORWARD -i ci+ -j ACCEPT
Allow access to my home subnet
Code:
iptables -I FORWARD -i ci+ -o br0 -j ACCEPT
iptables -I FORWARD -i br0 -o ci+ -j ACCEPT
What I did successfully:
Any device under the custom interface can
ping
the router, and vice versa.Any device under the custom interface can use 8.8.8.8 DNS or other public DNS.
Without using NAT rules, custom interface using public DNS can access the Internet normally.
Needs I can't achieve:
None of the devices under the custom interface can use the router's 192.168.50.1 as the DNS server, and there is no response.
But I can use other DNS servers in my home subnet, such as 192.168.50.2 (hosted by another router). This proves that the custom interface can normally access my home subnet.
I used the command below to intercept DNS requests to my router, but after using it, I still did not get any DNS response.
Code:
iptables -t nat -I PREROUTING -i ci+ -p udp --dport 53 -j DNAT --to 192.168.50.1
iptables -t nat -I PREROUTING -i ci+ -p tcp --dport 53 -j DNAT --to 192.168.50.1
I just found that there is a DNS server on my VPN interface, so I tried to use the NAT command below to reset the DNS request to the VPN client. This command works normally. But I hope that DNS requests through the router.
Code:
iptables -t nat -I PREROUTING -i ci+ -p udp --dport 53 -j DNAT --to 10.8.0.1
The current state is
The custom interface:
Can access Internal: OK
Can ping the router and vice versa: OK
Can access Internet: OK
Can get public DNS response: OK
Can get the DNS response from the router: NO
So, what should I do so that the custom interface can get the router's DNS response?
Background Information:
I enabled DNS over TLS, And the DNSFilter is enabled (it has been tested to close the DNSFilter is still not working)
My router's RT-AC86U runs 386.2_4 firmware.
I will restart the firewall after each test, so there is no iptables rule conflict.
Last edited: