Hi,
I want to run a second subnet. For the sake of discussion, no VLAN in use. Everything untagged.
The hosts/servers in the second network should be able to be accessed via:
Wanted Connections 192.168.100.0/24 -> 192.168.6.0/28
- PING
- SSH - Port 22
- Web Port 80/443
192.168.6.0/28 <-- no access outside of 192.168.6.0/28 should be granted.
(not even WAN/gateway for the moment)
+-----+
|Modem|
+--+--+
| Network Address: 192.168.100.0/246
WAN| Usable Host IP Range: 192.168.100.1 - 192.168.100.254
eth0.2| Broadcast Address: 192.168.100.255
DHCP| Total Number of Hosts: 256
+----+----+ Number of Usable Hosts: 254
|ROUTER #1| Subnet Mask: 255.255.255.0
+----+----+
LAN|
eth0.1|
192.168.100.1/24| +---------+ +--------------+
+--------------------------+ROUTER #0+----------------+--+SERVER #1 |
| LAN +---------+DMZ | |192.168.6.2/28|
LAN| eth0.1 eth0.2 | |192.168.6.2:80|
eth0| 192.168.100.20/24 192.168.6.1/28 | +--------------+
192.168.100.5/24| |
+------+------+ | +--------------+ +
|Client Laptop| +--+SERVER #2 |
+-------------+ |192.168.6.3/28|
|192.168.6.3:80|
+--------------+
Network Address: 192.168.6.0/28
Usable Host IP Range: 192.168.6.1 - 192.168.6.14
Broadcast Address: 192.168.6.15
Total Number of Hosts: 16
Number of Usable Hosts: 14
Subnet Mask: 255.255.255.240
Settings on Router#1 are so far easy.
I just added a static route.
Target 192.168.6.0 => Gateway 192.168.100.20
root@router1:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.6.0 router2 255.255.255.240 UG 0 0 0 br-lan
On Router#2
root@router2:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.100.1 0.0.0.0 UG 0 0 0 eth0
192.168.6.0 * 255.255.255.240 U 0 0 0 net3
192.168.100.0 * 255.255.255.0 U 0 0 0 eth0
Firewall Settings:
config defaults
option input 'ACCEPT'
option output 'ACCEPT'
option synflood_protect '1'
option forward 'REJECT'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
DMZ Settings.
config interface 'dmz'
option proto 'static'
option device 'net3'
option gateway '192.168.100.1'
option ipaddr '192.168.6.1'
option netmask '255.255.255.240'
option broadcast '192.168.6.15'
On Router2 - Firewall Settings
config zone
option name 'dmz'
list network 'dmz'
option output 'REJECT'
option input 'REJECT'
option forward 'REJECT'
# Allow all LAN stations to SSH to DMZ stations
config rule
option name 'ACCEPT-SSH-LAN-2-DMZ'
option src 'lan'
option dest 'dmz'
option proto 'tcp'
option family 'ipv4'
option dest_port '22'
option target 'ACCEPT'
option enabled '1'
# Allow all LAN stations to :80 to DMZ stations
config rule
option name 'ACCEPT-:80-LAN-2-DMZ'
option src 'lan'
option dest 'dmz'
option proto 'tcp'
option family 'ipv4'
option dest_port '80'
option target 'ACCEPT'
option enabled '1'
# Allow all LAN stations to ICMP/Ping to DMZ stations
config rule
option name 'Allow-Ping LAN-2-DMZ'
option src 'lan'
option dest 'dmz'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'
option enabled '1'
That works perfect. So Far.
From LAN i have access to the DMZ zone.
I want now to create more DMZ Zones and separate and firewall them against each other.
One of the DMZ Zones should be a central APT-MIRROR WebServer for my Debian systems.
So all the DMZ Zones should also be able to connect to the APT-MIRROR System via port 80. Port 80 only.
The DMZ Lan is using following network, 192.168.6.16/28, Router#2 Interface at 192.168.6.17, the APT Server at 192.168.6.18.
It's more or less a direct copy from DMZ to DMZ_APT.
Connections from LAN->DMZ_APT work super.
config zone
option name 'dmz_apt'
list network 'dmz_apt'
option output 'REJECT'
option input 'REJECT'
option forward 'REJECT'
config rule
option src 'lan'
option dest 'dmz_apt'
option proto 'tcp'
option family 'ipv4'
option dest_port '22'
option target 'ACCEPT'
option name 'ACCEPT-SSH-LAN-2-APT_DMZ'
config rule
option src 'lan'
option dest 'dmz_apt'
option proto 'tcp'
option family 'ipv4'
option dest_port '80'
option target 'ACCEPT'
option name 'ACCEPT-:80-LAN-2-APT_DMZ'
config rule
option src 'lan'
option dest 'dmz_apt'
option proto 'icmp'
option family 'ipv4'
option target 'ACCEPT'
option name 'Allow-Ping LAN-2-APT_DMZ'
list icmp_type 'echo-request'
Now comes my issue.
Network Address: 192.168.6.0/28
Usable Host IP Range: 192.168.6.1 - 192.168.6.14
Broadcast Address: 192.168.6.15
Total Number of Hosts: 16
Number of Usable Hosts: 14
Subnet Mask: 255.255.255.240
Network Address: 192.168.6.16/28
Usable Host IP Range: 192.168.6.17 - 192.168.6.30
Broadcast Address: 192.168.6.31
Total Number of Hosts: 16
Number of Usable Hosts: 14
Subnet Mask: 255.255.255.240
+---------+ +--------------+
--+ROUTER #2+----------------+--+SERVER #1 |
+-+-------+DMZ1 | |192.168.6.2/28|
| eth0.2 | |192.168.6.2:80|
DMZ2 | 192.168.6.1/28 | +--------------+
eth0.3 | |
192.168.6.17/28 | | +--------------+
| +--+SERVER #2 |
| +---------------+ |192.168.6.3/28|
+-+SERVER #3 | |192.168.6.3:80|
|192.168.6.18/28| +--------------+
|192.168.6.18:80|
+---------------+
I want now my DMZ-Zone Systems to connect to port 80 to the systems in the DMZ_APT System.
So my DMZ-Servers may do their update from another DMZ-Zone.
- I want now to be able to connect from DMZ->DMZ_APT with Port 80.
And - From DMZ to the Gateway, to have a DNS lookup.
The dnsmasq on Router#2 binds to 192.168.6.17/28:53
apt.mydomain.lan ->
config rule
option name 'http-80-APT'
list proto 'tcp'
option dest_port '80'
option target 'ACCEPT'
option family 'ipv4'
option dest 'dmz_apt'
option src 'dmz'
config rule
option name 'ACCEPT-DNS-DMZ-2-LAN'
option src 'dmz'
option proto 'tcp udp'
option family 'ipv4'
option dest_port '53'
option target 'ACCEPT'
option dest '*'
I still do not get it, what else needs to be set to have port 80/http to DMZ_APT and port 53/dns to the gateway.
Any idea which setting i miss here?