I have an Ubuntu machine that is my firewall
The Machine has 2 NIC Cards. eth0 and eth1. eth1 is connected to a modem that gives it an IP of 10.10.1.X
eth1 is required to provide DHCP on 192.168.2.X and have another IP from a switch that is connected to a router that provides DHCP on 192.168.1.X
Currently this machine has the following IPs
eth0 - 10.10.0.4
eth1 - 192.168.2.1 (DHCP Server, Gateway)
eth1:0 - 102.168.1.103
I am trying to accomplish the following
If a machine is connected to eth1 over a switch, It should be able to ping 192.168.1.10 which
[Modem+Router 10.1.1.0/24]
|
|
|
(eth0) |----- [ Server 192.168.1.10]
Ubuntu |
Firewall (eth1) ----- [Switch]-----[Modem+Router 192.168.1.0/24]
(eth1:0)--------| \
\
\--------[EndPoint 192.168.2.4]
My fundamental problem lies in the fact that I receive packets coming from 2.4 that are destined for the internet and I am able to route them properly using IpTables. Whereas, If a packet arrives for 1.10, I am supposed to send it back to the switch with the appropriate options set.
I have tried the following
- setting the default gateway for 1.0 to be 2.1 at 2.4 and set the next hop as 1.1 which i hoped would do the right forwarding
- I have also bridged eth1 and eth1:0 using
bridge-utils
and then applied iptables forwarding for anyone in 2.X wanting to go out to the internet from 10.10.0.1