# internet gateway inside the private network



## lezde716 (Aug 25, 2010)

I'm new to freebsd, I try to setup freebsd box inside my network this is a testing for an internet gateway.

Out Network Structure:
Modem -> Dlink router -> DSA-800 Firewall -> domain controller -> DHCP Server -> Client PC
ISP DNS are forwarded to domain controller. 

My Freebsd Internet Gateway is this:
Modem -> Dlink router -> DSA-800 Firewall -> domain controller -> DHCP Server -> Freebsd   Box -> winxp client pc in 192.168.5.0 network

Our internal IP 192.168.0.0/24
Internal DNS 192.168.0.228

my rc.conf

```
defaultrouter="192.168.0.1"
gateway_enable="YES"
hostname="pcname.domain.tld"
ifconfig_rl1="inet 192.168.5.1 netmask 255.255.255.0"
ifconfig_vr0="inet 192.168.0.239 netmask 255.255.255.0"
named_enable="YES"
named_flags="-u bind"
name_auto_forward_only="YES"
dhpcd_enable="YES"
firewall_enable="YES"
firewall_type="OPEN"
dhcpd_iface="rl0"
natd_enable="YES"
natd_interface="vr0"
natd_flag=""
```

resolv.conf

```
domain ourdomain.tld
nameserver 192.168.0.228
```

dhcpd.conf

```
subnet 192.168.5.0 netmask 255.255.255.0 {
range 192.168.5.100 192.168.5.200
option domain-name "hostname.ourdomain.tld";
option domain-name 192.168.5.1; 
option broadcast-address 192.168.5.0;
option routers 192.168.5.1;
default-lease-time 3600;
max-lease-time 8600;
}
subnet 192.168.0.0 netmask 255.255.255.0 {
}
```

named.conf

```
// listen-on { 127.0.0.1; };
listen-on { 192.168.5.1; };
```

My client PC IP:

```
ip address 192.168.5.100
subnet mask 255.255.255.0
default gateway 192.168.5.1
dhpc server 192.168.5.1
dns servers 192.168.5.1
```

my problem are this:

executing nslookup command the result is

```
Can't find server name for address 192.168.5.1: Non-Existent domain
default servers are not available
Server: Unknown
address: 192.168.5.1
Non-Authoritative Answer:
Name: yahoo.com
addresses: 72.30.2.43 and so on...
```

pinging 72.30.2.43 the reply is RTO

internet connection in freebsd box is fine but in client pc insternet connection cannot pass thru.

please help me about this matter. thanks


----------



## fbsd1 (Aug 27, 2010)

You have too much hardware in the way which is stepping on each other.

Modem -> Dlink router -> DSA-800 Firewall -> domain controller -> DHCP Server -> Freebsd Box -> winxp client pc in 192.168.5.0 network

The config should be  Modem -> Freebsd Box (gateway running DNS, DHCP & IPF firewall services)
Thats assuming that modem is not a phone company ISP service.


----------



## SirDice (Aug 27, 2010)

There is no DNS server running on 192.168.5.1, hence the error message.


----------



## Myron (Aug 27, 2010)

try this net.inet.ip.forwarding to 1


----------



## SirDice (Aug 27, 2010)

Myron said:
			
		

> try this net.inet.ip.forwarding to 1



The OP already has *gateway_enable="YES"* which does the exact same thing.


----------



## lezde716 (Sep 15, 2010)

Thanks everybody for the help. I already solve this. I create another copy of kernel then I edit and put these in the kernel I'd copy and recompile it. and it works.

```
options    IPFIREWALL
options    IPFIREWALL_VERBOSE
options    IPFIREWALL_DEFAULT_TO_ACCEPT
options    IPDIVERT
```


----------

