How to redirect unknown users from one subnet to another ubuntu?

How to create one from the same subnet 172.32.0.0 , made the transition to address 172.32.0.1? I have the manual how to do this setting in freebsd to do under ubuntu 12?

1. Freebsd dhcp config:
172.32.0.0 subnet netmask 255.255.240.0 {
default-lease-time 3600;
option domain-name "isp";
option subnet-mask 255.255.240.0;
option domain-name-servers 172.32.0.1;
option routers 172.32.0.1;
range 172.32.0.100 172.32.0.254;

2. In freebsd, the alias in /etc/rc.conf:
ifconfig_em0_alias0="inet netmask 255.255.240.0 172.32.0.1"

3. Freebsd inversion on yourself for that subnet in /etc/firewall.conf:
redirect unknown users
${FwCMD} add 5 fwd 127.0.0.1,80 ip from 172.32.0.0/20 to not me dst-port 80


How to create one in Ubuntu ?
September 26th 19 at 07:04
2 answers
September 26th 19 at 07:06
Solution
So it's very different. For your reference, as I understand it, trying to build a captive portal. But for these purposes there are ready solutions. pfsense is also for example
September 26th 19 at 07:08
sorry maybe something did not finish, it is necessary to do so , when someone wants to open a website vk.com it will spread to 172.32.0.1.
So can you proxy to put? For example SQUID.
What you have described above, FreeBSD will redirect all sites to 172.32.0.1. Not only vk.com and in General, all requests 80-th port. - Cameron_Weissn commented on September 26th 19 at 07:11
indeed I want to create one here UTB wiki.ubilling.net.ua/doku.php?id=uhw
but only for ubunutu - Jazlyn.Price commented on September 26th 19 at 07:14
So it's very different. For your reference, as I understand it, trying to build a captive portal. But for these purposes there are ready solutions. pfsense is also for example - Cameron_Weissn commented on September 26th 19 at 07:17
Thanks for suggesting for captive portal, useful. Need to do so: the user connected to the network , got an ip address , when popitke go to any website , it will show the local site with 172,32,0,1 where he vivodit your Mac address you need to contact the provider for autorizatii . - Jazlyn.Price commented on September 26th 19 at 07:20
Well, this is a captive portal is. Download the link that I pointed out the distribution. There is to install, or just working images. Setting up the go and understand. Everything is intuitive - Cameron_Weissn commented on September 26th 19 at 07:23
Thank you. As is rightly put decisions matter ? Can write ischo times the answer about captive portal. - Jazlyn.Price commented on September 26th 19 at 07:26
Fixed your answer. Thank you - Cameron_Weissn commented on September 26th 19 at 07:29

Find more questions by tags DHCPFirewallFreeBSDUbuntu