Quantcast
Channel: EdgeRouter topics
Viewing all articles
Browse latest Browse all 20028

Hairpin NAT from VLAN1 to VLAN2 (I cannot access my webserver on VLAN2 from main LAN)

$
0
0

I started out trying to setup a Unifi Security Gateway to do this and gave up.

 

Now I am using an EDGEROUTER LITE.

 

I have 5 Public IP's.

 

I have 15 Ring Central VOIP phones. They are on VLAN3

 

I have a web server that is live on the INTERNET through one of my public IP's on VLAN2

 

On the main network:

I have a domain controller with the Microsoft Essentials Experience running.

I have an Exchange Server.

 

I have 15 Client computers.

 

I have SNAT and DNAT rules so that the web server, the essentials experience, and the exchange server, are all available from the internet via their own public IP's.

 

I can access the essentials exerience and the exchange server from the main local network with their Public IP's.

 

I cannot access our web server on VLAN2 from the main network.

 

 

 

My config.boot file is as follows:

 

 

 

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 20 {
            action modify
            description "do NOT load balance destination public address"
            destination {
                group {
                    address-group ADDRv4_eth0
                }
            }
            modify {
                table main
            }
        }
        rule 30 {
            action modify
            description "do NOT load balance destination public address"
            destination {
                group {
                    address-group ADDRv4_eth1
                }
            }
            modify {
                table main
            }
        }
        rule 100 {
            action modify
            modify {
                lb-group G
            }
        }
    }
    name WAN1_IN {
        default-action drop
        description ""
        rule 10 {
            action accept
            description "RDP HYPER-V-02"
            destination {
                address 192.168.2.4
                port 3389
            }
            log disable
            protocol tcp_udp
        }
        rule 20 {
            action accept
            description "HTTP DC-SERVER"
            destination {
                address 192.168.2.5
                port 80
            }
            log disable
            protocol tcp_udp
        }
        rule 30 {
            action accept
            description "HTTPS DC-SERVER"
            destination {
                address 192.168.2.5
                port 443
            }
            log disable
            protocol tcp_udp
        }
        rule 40 {
            action accept
            description "RDP DC-SERVER"
            destination {
                address 192.168.2.5
                port 3389
            }
            log disable
            protocol tcp_udp
        }
        rule 50 {
            action accept
            description "HTTP EXCH-SERVER"
            destination {
                address 192.168.2.6
                port 80
            }
            log disable
            protocol tcp_udp
        }
        rule 60 {
            action accept
            description "HTTPS EXCH-SERVER"
            destination {
                address 192.168.2.6
                port 443
            }
            log disable
            protocol tcp_udp
        }
        rule 70 {
            action accept
            description "RDP EXCH-SERVER"
            destination {
                address 192.168.2.6
                port 3389
            }
            log disable
            protocol tcp_udp
        }
        rule 80 {
            action accept
            description HTTP_IIS-2012R2
            destination {
                address 192.168.1.10
                port 80
            }
            log disable
            protocol tcp_udp
        }
        rule 90 {
            action accept
            description HTTPS_IIS-2012R2
            destination {
                address 192.168.1.10
                port 443
            }
            log disable
            protocol tcp_udp
        }
        rule 100 {
            action accept
            description "Allow Established/Related"
            log disable
            protocol all
            state {
                established enable
                invalid disable
                new disable
                related enable
            }
        }
        rule 110 {
            action drop
            description "Drop Invalid"
            log disable
            protocol all
            state {
                established disable
                invalid enable
                new disable
                related disable
            }
        }
    }
    name WAN2_IN {
        default-action drop
        description ""
    }
    receive-redirects disable
    send-redirects enable
    source-validation disable
    syn-cookies enable
}
interfaces {
    ethernet eth0 {
        address x.x.x.114/29
        address x.x.x.115/29
        address x.x.x.116/29
        address x.x.x.117/29
        address x.x.x.118/29
        description WAN
        duplex auto
        firewall {
            in {
                name WAN1_IN
            }
        }
        speed auto
    }
    ethernet eth1 {
        address dhcp
        description "WAN 2"
        duplex auto
        speed auto
    }
    ethernet eth2 {
        address 192.168.2.1/24
        description Local
        duplex auto
        speed auto
        vif 2 {
            address 192.168.1.1/24
            description DMZ
            mtu 1500
        }
        vif 3 {
            address 192.168.3.1/24
            description VOIP
            mtu 1500
        }
    }
    loopback lo {
    }
}
load-balance {
    group G {
        interface eth0 {
        }
        interface eth1 {
            failover-only
        }
    }
}
port-forward {
    auto-firewall enable
    hairpin-nat enable
    lan-interface eth2
    rule 1 {
        description "RDP Hyper-V-01"
        forward-to {
            address 192.168.2.3
            port 3389
        }
        original-port 3389
        protocol tcp_udp
    }
    wan-interface eth0
}
protocols {
    static {
        route 0.0.0.0/0 {
            next-hop x.x.x.113 {
            }
        }
    }
}
service {
    dhcp-server {
        disabled false
        hostfile-update disable
        shared-network-name DMZ {
            authoritative disable
            subnet 192.168.1.0/24 {
                default-router 192.168.1.1
                dns-server 8.8.8.8
                dns-server 8.8.4.4
                lease 86400
                start 192.168.1.100 {
                    stop 192.168.1.240
                }
            }
        }
        shared-network-name VOIP {
            authoritative disable
            subnet 192.168.3.0/24 {
                default-router 192.168.3.1
                dns-server 8.8.8.8
                dns-server 8.8.4.4
                lease 86400
                start 192.168.3.100 {
                    stop 192.168.3.240
                }
            }
        }
    }
    dns {
        forwarding {
            cache-size 150
            listen-on eth2
        }
    }
    gui {
        http-port 80
        https-port 443
        older-ciphers enable
    }
    nat {
        rule 1 {
            description "Map x.x.x.115 to 192.168.1.10"
            destination {
                address x.x.x.115
            }
            inbound-interface eth0
            inside-address {
                address 192.168.1.10
            }
            log disable
            protocol all
            type destination
        }
        rule 2 {
            description "Map x.x.x.116 to 192.168.2.5"
            destination {
                address x.x.x.116
            }
            inbound-interface eth0
            inside-address {
                address 192.168.2.5
            }
            log disable
            protocol all
            type destination
        }
        rule 3 {
            description "Map x.x.x.117 to 192.168.2.6"
            destination {
                address x.x.x.117
            }
            inbound-interface eth0
            inside-address {
                address 192.168.2.6
            }
            log disable
            protocol all
            type destination
        }
        rule 4 {
            description "Map x.x.x.118 to 192.168.2.4"
            destination {
                address x.x.x.118
            }
            inbound-interface eth0
            inside-address {
                address 192.168.2.4
            }
            log disable
            protocol all
            type destination
        }
        rule 5 {
            description "Hairpin x.x.x.115 to 192.168.1.10"
            destination {
                address x.x.x.115
            }
            inbound-interface eth2
            inside-address {
                address 192.168.1.10
            }
            log disable
            protocol all
            type destination
        }
        rule 6 {
            description "Hairpin x.x.x.116 to 192.168.2.5"
            destination {
                address x.x.x.116
            }
            inbound-interface eth2
            inside-address {
                address 192.168.2.5
            }
            log disable
            protocol all
            type destination
        }
        rule 7 {
            description "Hairpin x.x.x.117 to 192.168.2.6"
            destination {
                address x.x.x.117
            }
            inbound-interface eth2
            inside-address {
                address 192.168.2.6
            }
            log disable
            protocol all
            type destination
        }
        rule 5000 {
            description "Map 192.168.1.10 to x.x.x.115"
            log disable
            outbound-interface eth0
            outside-address {
                address x.x.x.115
            }
            protocol all
            source {
                address 192.168.1.10
            }
            type source
        }
        rule 5001 {
            description "Map 192.168.2.5 to x.x.x.116"
            log disable
            outbound-interface eth0
            outside-address {
                address x.x.x.116
            }
            protocol all
            source {
                address 192.168.2.5
            }
            type source
        }
        rule 5002 {
            description "Map 192.168.2.6 to x.x.x.117"
            log disable
            outbound-interface eth0
            outside-address {
                address x.x.x.117
            }
            source {
                address 192.168.2.6
            }
            type source
        }
        rule 5003 {
            description "masquerade for WAN"
            outbound-interface eth0
            type masquerade
        }
        rule 5004 {
            description "masquerade for WAN 2"
            outbound-interface eth1
            type masquerade
        }
    }
    ssh {
        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 ubnt
    login {
        user ubnt {
            authentication {
                encrypted-password $6$WhHECqNQBu/bAE$Jja4Q0EQNeFolyQLWlKpA/YxKoqG4UDv22WuA9PWaO4HOI.0BnK1tvgbOg/3h8TaSve7gw0HqyWVna8IH7vXv/
            }
            level admin
        }
    }
    name-server 192.168.2.5
    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 {
        }
    }
    syslog {
        global {
            facility all {
                level notice
            }
            facility protocols {
                level debug
            }
        }
    }
    time-zone UTC
}


/* Warning: Do not remove the following line. */
/* === vyatta-config-version: "config-management@1:conntrack@1:cron@1:dhcp-relay@1:dhcp-server@4:firewall@5:ipsec@5:nat@3:qos@1:quagga@2:system@4:ubnt-pptp@1:ubnt-util@1:vrrp@1:webgui@1:webproxy@1:zone-policy@1" === */
/* Release version: v1.8.5.4884695.160608.1057 */

 


Viewing all articles
Browse latest Browse all 20028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>