Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can you help me with my router setup and iptables
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cheops2006
n00b
n00b


Joined: 15 Sep 2006
Posts: 16

PostPosted: Sat Feb 15, 2014 9:40 pm    Post subject: Can you help me with my router setup and iptables Reply with quote

Hi,

I have setup a PPTP to work on my router but I'm not happy with it because I have to have redirect internet traffic and create NAT checked for it to work. I found a script that I modified slightly for my own purposes but don't fully understand how it works.

Code:

for i in /proc/sys/net/ipv4/conf/*/rp_filter ; do
  echo 0 > $i
done

ip route flush table 100
ip route del default table 100
ip rule del fwmark 1 table 100
ip route flush cache
iptables -t mangle -F PREROUTING

ip route show table main | grep -Ev ^default | grep -Ev ppp0 \
  | while read ROUTE ; do
      ip route add table 100 $ROUTE
done

ip route add default table 100 via $(nvram get wan_gateway)
ip rule add fwmark 1 table 100
ip route flush cache

iptables -t mangle -A PREROUTING -i br0 -j MARK --set-mark 1
iptables -t mangle -A PREROUTING -i br1 -j MARK --set-mark 0
iptables -t mangle -A PREROUTING -i br2 -j MARK --set-mark 0
iptables -t mangle -A PREROUTING -i br3 -j MARK --set-mark 1


What I want to do is setup table 100 br1 to be my vpn and not the default table.

Many thanks for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
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