solution linux (delete IPTABLES) command (hope you can help me with this)

hello,

a few weeks i placed a topic in this forum about my Netgear wit DD-WRT,  how disclude devices so they wil not go trough the PIA VPN.

short version from this is,
i have a Netgear running with PIA VPN, but at this moment al my trafic is going through the VPN.
i like to have a option to select with device,mac adres of IP (that dussent does not matter) is going through the PIA VPN and with is goint trough the normale provider IP.

does anyone know a solution for this?, a setting in the Netgear router i use with DD-WRT software.
-----------------

i got a answer from a user Anna, that give me this hint,

First set a static IP for the device you wish to exclude then perform the following

Go to your Administration -> Commands tab in the DD-WRT config.
In the Firewall section, click Edit and add the following :

echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter  
iptables -t mangle -F PREROUTING  
ip route add default table 200 via $(nvram get wan_gateway)  
ip rule add fwmark 1 table 200  
ip route flush cache
iptables -t mangle -I PREROUTING -i br0 -s <theip> -j MARK --set-mark 1
change the <theip> to the ip that will excluded from the VPN Then click save to firewall within
the Administration=> Commands section.

Hope this helps!
------------------------------

and i think thats the solution,  so i ask,
--------------------------
Tnx for your update,  if i read i correct it for me like this,

echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
iptables -t mangle -F PREROUTING
ip route add default table 200 via $(nvram get wan_gateway)
ip rule add fwmark 1 table 200
ip route flush cache
iptables -t mangle -I PREROUTING -i br0 -s 192.168.2.25 -j MARK --set-mark 1

and now example internal IP is excluded for the PIA VPN ?

also one new question,
say i want to correct it again and example IP 192,168.2.25 must go trough thePIA VPN again.
can i delete the "rule" again ?.
---------------------------

but the Delete rule i never got a answer anymore. becourse is a form of Linux i hope you guy's can Help me with this ?
my question about this is:

say i want to correct it again and example IP 192,168.2.25 must go trough thePIA VPN again.
can i delete the "rule" again ?.
---------------------------

i hope some linux wizards can help me with this ?

Comments

  • edited February 2018
    IIRC to add rules manually to a Netgear router or add them in DD-WRT, you have to put them into a text box and submit them to the router.
    To undo them, then, you remove the rules from advanced configuration text box and then reboot the router.
  • martouf said:
    IIRC to add rules manually to a Netgear router or add them in DD-WRT, you have to put them into a text box and submit them to the router.
    To undo them, then, you remove the rules from advanced configuration text box and then reboot the router.

    can you help me with the remove option for the rule ?. let say i want to remove the rule of IP 192.168.2.25 again ?.

    tnx

  • remove the line
    iptables -t mangle -I PREROUTING -i br0 -s 192.168.2.25 -j MARK --set-mark 1

    from the advanced configuration text box (leave the rest, they won't matter any more), and hit save. then restart the router.


Sign In or Register to comment.