- [Instructor] Compared to setting up a router host,
adding new network firewall features
is fairly straightforward.
Let's set up our Ubuntu router host
as a network firewall in this lesson.
Network firewalls handle service requests
by either blocking them or providing port forwarding.
The prerequisite for port-forwarding
is a host set up as a router,
which in our case is the Ubuntu router host.
We need to add some new firewall rules
to enable port-forwarding
that routes a network service request
to an appropriate host behind a firewall.
The Ubuntu router host firewall
adheres to some default rules already.
For example, is dropping all the ingress traffic
or incoming traffic and it forwards all the egress
or outgoing traffic to the internet.
In addition to these default rules
we need to add the following port-forwarding details.
First of all, we need to open port 80
on the Ubuntu router host
and then send all the port 80 traffic
to a host running an HTTP or web server.
Here is a big picture view.
A packet arrives whose destination port is 80
from the internet at the external network interface card
of our Ubuntu router host ETH0.
The network interface card has the IP address of 10.0.0.6.
If we have our port-forwarding rules set up
this packet will be then
sent to the internal network interface card
of the Ubuntu router host ETH1.
Next, it's sent to a switch.
The switch then passes it on to our Ubuntu host
whose IP is 10.0.0.5.
The local host has only one network interface card
and the IP address of that network interface card is
10.0.0.5.
The Ubuntu local hosts network interface card or NIC,
ETH0 has it's port 80 open
to receive all the hypertext transfer protocol
or HTTP traffic.
Now, the key here is the original package destination IP
has to be changed from 10.0.0.6 to 10.0.1.5
to arrive at the Ubuntu local host eventually.
We don't have to do anything
about the destination port number
because the initial port number stays the same, which is 80.
That's all we have to do on the Ubuntu router host
to activate port forwarding.