how to make this:
have:
- Centos 6.5
- WAN1 eth0 44.44.44.44 (DEFROUTE=yes)
- WAN2 ppp0 95.95.95.95 (DEFROUTE=no)
- HTTP server work and available only in eth0
- DNS server work but port 53 blocked in eth0
- ping available only in eth0
- client can access through eth0 to HTTP and PING
- ISP block port 53 in eth0
- ISP block port 80 in ppp0
need:
- client PC must can access PING both eth0 and ppp0
- client PC must can stay access to HTTP in eth0
- client PC must can access to DNS in ppp0
I try make this but did not understand until the end how to do it:
echo 2 ppp0_OUT >> /etc/iproute2/rt_tables
ip route add default via 95.95.95.95 dev ppp0 table ppp0_OUT
iptables -A PREROUTING -i ppp0 -t mangle -j MARK --set-mark 2
ip rule add fwmark 2 table ppp0_OUT
ip route flush cache
sysctl -w net.ipv4.conf.eth0.rp_filter=0
sysctl -w net.ipv4.conf.ppp0.rp_filter=0
question:
1) How to make that the client PC could access the server at the same time via eth1 and via ppp0
2) client PC must have acces to DNS via ppp0 and to HTTP via eth0
it is wery simple answer :)
just need:
answer: WAN1 have options DEFROUTE=yes and when WAN1 start he was:
WAN2 NOT have default route!!! we need create default route for WAN2 it simple script for do it: