As a router I use Ubuntu 16.04
with 2 network cards. The current configuration is very simple - white IPv4
on the external interface and NAT
by ufw
on the internal one. As a DHCP
and caching DNS
server, I use dnsmasq
. My ethernet switch supports VLAN
, but now this feature is disabled.
I often connect new devices (new virtual machines) to the local network and by default they all immediately access the Internet, which I don’t really like.
I want to change the configuration so that NAT
works only for the hosts from the white list, and everyone else has access to local resources, but not to the Internet.
How is this best / easiest to do? It is advisable without changing the ufw
and dnsmasq
on their counterparts (since I have already partially dealt with these programs)
While I have the following ideas:
- configure different
dhcp
ranges and by default assign the wronggateway
- assign an internal network interface card several
IP
addresses from different subnets and doNAT
for only one subnet - enable
VLAN
support on the switch and use this functionality in some way (I don’t know how, I’ve just been going to deal withVLAN
long time)
ufw
Iufw
not say, I can say forshorewall
. I am using it and the old company collective farm distribution of the Internet for several small firms in the same building. If it were not for the killed iron - it would still plow (although it worked for 5 years). - don Rumata