Disable WAN access to a IP address?

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
lolcocks
DD-WRT User


Joined: 31 May 2013
Posts: 137

PostPosted: Sat May 30, 2020 6:27    Post subject: Disable WAN access to a IP address? Reply with quote
Hello,

I am running DD-WRT on my R6400.
I want to disable WAN to a single IP address, lets say 10.0.0.2 for instance.

It's wired but from the R6400 router, it goes to a switch and then the PC.

How can I completely disable internet access to it? I don't even want a single packet to hit the internet from that machine.


Last edited by lolcocks on Sat May 30, 2020 13:48; edited 1 time in total
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12915
Location: Netherlands

PostPosted: Sat May 30, 2020 7:28    Post subject: Re: Disable WAN access to a IP address? Reply with quote
lolcocks wrote:
Hello,

I am running DD-WRT on my R6400.
I want to disable WAN to a single IP address, lets say 10.0.0.2 for instance.

It's wired but from the R7000 router, it goes to a switch and then the PC.

How can I completely disable internet access to it? I don't even want a single packet to hit the internet from that machine.


Disable WAN to a single IP address? I am afraid I do not understand that but English is not my native language

If this R6400 is a secondary router connected to an R7000, consider setting it up as a WAP then you have WAN disabled and can control everything from the R7000

https://wiki.dd-wrt.com/wiki/index.php/Wireless_Access_Point

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
lolcocks
DD-WRT User


Joined: 31 May 2013
Posts: 137

PostPosted: Sat May 30, 2020 13:35    Post subject: Re: Disable WAN access to a IP address? Reply with quote
egc wrote:
lolcocks wrote:
Hello,

I am running DD-WRT on my R6400.
I want to disable WAN to a single IP address, lets say 10.0.0.2 for instance.

It's wired but from the R7000 router, it goes to a switch and then the PC.

How can I completely disable internet access to it? I don't even want a single packet to hit the internet from that machine.


Disable WAN to a single IP address? I am afraid I do not understand that but English is not my native language

If this R6400 is a secondary router connected to an R7000, consider setting it up as a WAP then you have WAN disabled and can control everything from the R7000

https://wiki.dd-wrt.com/wiki/index.php/Wireless_Access_Point


I completely fucked up that description. I think I needed sleep.

What I wanted to say was I have a R6400 1 ethernet cable from the R6400 goes to the switch.

From the switch, it goes to 8 different machines. Of those 8 machines, I want to disable internet access to one of those machines, not a single packet should go through.
Wildlion
DD-WRT Guru


Joined: 24 May 2016
Posts: 1416

PostPosted: Sat May 30, 2020 13:43    Post subject: Reply with quote
iptables -I FORWARD -s 10.0.0.2 -j REJECT --reject-with tcp-reset


This will prevent any packets from that IP address getting forwarded across the NAT router to the internet

This will not prevent packets from being relayed on the switch, since those will not go through the firewall, for that you would need to reconfigure the switch (using something like vlans)
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6870
Location: Romerike, Norway

PostPosted: Sat May 30, 2020 14:40    Post subject: Reply with quote
iptables -I FORWARD -s 10.0.0.2 -o `get_wanface` -j REJECT --reject-with tcp-reset

Specify an output interface to prevent traffic to other parts of your network to be blocked.
pault99
DD-WRT Novice


Joined: 11 Apr 2017
Posts: 14

PostPosted: Fri Jun 19, 2020 20:50    Post subject: Reply with quote
Remove the Gateway from the static NIC settings on that PC / Laptop.

Providing the PC is logged in as a user, and not Administrator then they will not be able to modify the NIC settings.
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6446
Location: UK, London, just across the river..

PostPosted: Sat Jun 20, 2020 9:46    Post subject: Reply with quote
more elegant way... Laughing

iptables -I FORWARD -i br0 -o $(nvram get wan_iface) -p tcp -s 10.0.0.2 -j REJECT
iptables -I FORWARD -i br0 -o $(nvram get wan_iface) -p udp -s 10.0.0.2 -j REJECT

if you need it like that, it will still have the LAN, but no WAN access

or

iptables -I FORWARD -i br0 -s 10.0.0.2 -o `get_wanface` -j REJECT

we have to assume, you have only br0 (Switch + WiFi),otherwise you have to use the default interface...that is concerned...

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum