Quantcast
Channel: All EdgeRouter posts
Viewing all articles
Browse latest Browse all 60861

Re: Time based firewall rules & force DNS to specific subnet

$
0
0

Hi..
I found the problem is my network always go to 2nd WAN (failover only).
When I do traceroute to 8.8.8.8 from EdgeRouter it go to 1st WAN (pppoe).
But when I trace route from my network (from my notebook & other devices) it go to 2nd WAN.
How come? My 1st WAN is connected.
This is my configuration.

firewall {
all-ping enable
broadcast-ping disable
group {
network-group PRIVATE_NETS {
network 192.168.0.0/16
network 172.16.0.0/12
network 10.0.0.0/8
}
}
ipv6-receive-redirects disable
ipv6-src-route disable
ip-src-route disable
log-martians disable
modify balance {
rule 10 {
action modify
description "do NOT load balance lan to lan"
destination {
group {
network-group PRIVATE_NETS
}
}
modify {
table main
}
}
rule 30 {
action modify
description "do NOT load balance destination public address"
destination {
group {
address-group ADDRv4_pppoe1
}
}
modify {
table main
}
}
rule 40 {
action modify
description "do NOT load balance destination public address"
destination {
group {
address-group ADDRv4_eth2
}
}
modify {
table main
}
}
rule 100 {
action modify
modify {
lb-group G
}
}
}
name 8net_in {
default-action accept
rule 1 {
action accept
description "Allow established & related"
state {
established enable
related enable
}
}
rule 2 {
action accept
description "Accept source 9net"
source {
address 192.168.9.0/27
}
}
rule 3 {
action drop
description "Drop destination 8net"
destination {
address 192.168.8.0/27
}
}
}
name WAN_IN {
default-action drop
description "WAN to internal"
rule 10 {
action accept
description "Allow established/related"
state {
established enable
related enable
}
}
rule 20 {
action drop
description "Drop invalid state"
state {
invalid enable
}
}
}
name WAN_LOCAL {
default-action drop
description "WAN to router"
rule 10 {
action accept
description "Allow established/related"
state {
established enable
related enable
}
}
rule 20 {
action accept
description "Allow IKE, L2TP & NAT-T"
destination {
port 500,1701,4500
}
log disable
protocol udp
}
rule 30 {
action accept
description "Allow ESP"
log disable
protocol esp
}
rule 40 {
action drop
description "Drop invalid state"
state {
invalid enable
}
}
}
options {
mss-clamp {
mss 1412
}
}
receive-redirects disable
send-redirects enable
source-validation disable
syn-cookies enable
}
interfaces {
ethernet eth0 {
address 192.168.8.1/27
description 8net
duplex auto
speed auto
vif 88 {
address 192.168.88.1/27
description 8net-88
firewall {
in {
name 8net_in
}
}
mtu 1500
}
}
ethernet eth1 {
description WAN
duplex auto
pppoe 1 {
default-route auto
firewall {
in {
name WAN_IN
}
local {
name WAN_LOCAL
}
}
mtu 1492
name-server auto
password ****************
user-id 152501208281@telkom.net
}
speed auto
}
ethernet eth2 {
address 192.168.9.10/27
description 9net
duplex auto
firewall {
in {
name 8net_in
}
}
speed auto
}
ethernet eth3 {
address 192.168.10.1/28
description Synology-RS815
duplex auto
firewall {
in {
modify balance
name 8net_in
}
}
speed auto
}
ethernet eth4 {
address 192.168.5.1/24
description 5net
duplex auto
firewall {
in {
name 8net_in
}
}
speed auto
}
ethernet eth5 {
address 192.168.7.1/24
description 7net
duplex auto
firewall {
in {
name 8net_in
}
}
speed auto
}
ethernet eth6 {
disable
duplex auto
speed auto
}
ethernet eth7 {
disable
duplex auto
speed auto
}
loopback lo {
}
}
load-balance {
group G {
interface eth2 {
failover-only
}
interface pppoe1 {
}
lb-local enable
}
}
protocols {
static {
route 0.0.0.0/0 {
next-hop 192.168.9.1 {
}
}
route 192.168.13.0/27 {
next-hop 192.168.9.1 {
}
}
}
}
service {
dhcp-server {
disabled false
hostfile-update disable
shared-network-name 8net {
authoritative disable
subnet 192.168.8.0/27 {
default-router 192.168.8.1
dns-server 192.168.8.1
lease 86400
start 192.168.8.5 {
stop 192.168.8.24
}
}
}
shared-network-name 8net-88 {
authoritative disable
subnet 192.168.88.0/27 {
default-router 192.168.88.1
dns-server 192.168.88.1
lease 7200
start 192.168.88.2 {
stop 192.168.88.30
}
}
}
shared-network-name 5net {
authoritative disable
subnet 192.168.5.0/24 {
default-router 192.168.5.1
dns-server 192.168.5.1
lease 7200
start 192.168.5.11 {
stop 192.168.5.254
}
}
}
shared-network-name 7net {
authoritative disable
subnet 192.168.7.0/24 {
default-router 192.168.7.1
dns-server 192.168.7.1
lease 7200
start 192.168.7.11 {
stop 192.168.7.254
}
}
}
use-dnsmasq disable
}
dns {
dynamic {
interface pppoe1 {
service dyndns {
host-name all.dnsomatic.com
login user@yahoo.com
password ****************
server updates.dnsomatic.com
}
}
}
forwarding {
cache-size 150
listen-on eth0
listen-on eth0.88
listen-on eth4
listen-on eth5
}
}
gui {
http-port 80
https-port 443
listen-address 192.168.8.1
older-ciphers enable
}
nat {
rule 5000 {
description "masquerade for 1st WAN"
log disable
outbound-interface pppoe1
protocol all
type masquerade
}
rule 5001 {
description "masquerade for 2nd WAN"
destination {
group {
network-group PRIVATE_NETS
}
}
exclude
log disable
outbound-interface eth2
protocol all
source {
group {
network-group PRIVATE_NETS
}
}
type masquerade
}
rule 5002 {
description "masquerade for 2nd WAN"
destination {
}
log disable
outbound-interface eth2
protocol all
source {
group {
}
}
type masquerade
}
}
ssh {
listen-address 192.168.8.1
port 22
protocol-version v2
}
}
system {
conntrack {
expect-table-size 4096
hash-size 4096
table-size 32768
tcp {
half-open-connections 512
loose enable
max-retrans 3
}
}
host-name 8net-EdgeRouter-Pro
login {
user netadmin {
authentication {
encrypted-password ****************
}
full-name "Admin"
level admin
}
}
name-server 8.8.8.8
name-server 8.8.4.4
ntp {
server 0.ubnt.pool.ntp.org {
}
server 1.ubnt.pool.ntp.org {
}
server 2.ubnt.pool.ntp.org {
}
server 3.ubnt.pool.ntp.org {
}
}
offload {
hwnat disable
ipv4 {
forwarding enable
pppoe enable
}
}
syslog {
global {
facility all {
level notice
}
facility protocols {
level debug
}
}
}
time-zone Asia/Jakarta
}
traffic-control {
smart-queue SmartQueue {
download {
ecn enable
flows 1024
fq-quantum 1514
limit 10240
rate 15mbit
}
upload {
ecn enable
flows 1024
fq-quantum 1514
limit 10240
rate 1.5mbit
}
wan-interface eth1
}
}
vpn {
ipsec {
auto-firewall-nat-exclude enable
}
l2tp {
remote-access {
authentication {
local-users {
username admin {
password ****************
}
}
mode local
}
client-ip-pool {
start 192.168.8.25
stop 192.168.8.29
}
dns-servers {
server-1 8.8.8.8
server-2 8.8.4.4
}
ipsec-settings {
authentication {
mode pre-shared-secret
pre-shared-secret ****************
}
ike-lifetime 3600
}
outside-address 0.0.0.0
}
}
}

Thank you.


Viewing all articles
Browse latest Browse all 60861

Trending Articles