0% found this document useful (0 votes)
11 views

SDN3

Uploaded by

Rohit Moon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

SDN3

Uploaded by

Rohit Moon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SDN 3

Installation Process:
To create an SDN environment on Mininet and configure a switch to provide a firewall
functionality using POX controller, you can follow the steps below:

1. Install Mininet and POX controller:


Follow the installation guide at http://mininet.org/download/ to
install Mininet
Follow the installation guide at
https://github.com/noxrepo/pox/wiki/Installation to install POX
controller
2. Create a simple topology:
Open a terminal and run sudo mn --topo single,3 --mac --switch
ovsk --controller remote
This will create a topology with one switch and three hosts, and set
the controller as remote.
3. Configure the switch to provide firewall functionality:
Open a new terminal and navigate to the POX controller directory
Create a new Python file called firewall.py
firewall.py
Copy and paste the following code into the file:
python
from pox.core import core
import pox.openflow.libopenflow_01 as oflog =

core.getLogger()

class Firewall(object):

def init (self):


core.openflow.addListeners(self)
log.info("Firewall initialized.")

def _handle_ConnectionUp(self, event):msg =


of.ofp_flow_mod() msg.priority = 65535
msg.match.dl_type = 0x0800
msg.match.nw_proto = 6
msg.match.tp_dst = 80
msg.actions.append(of.ofp_action_output(port=of.OFPP_CONTROLLER)
)
event.connection.send(msg)

def launch():
core.registerNew(Firewall)

4. Run the POX controller:


In the terminal where you created the firewall.py file, run ./pox.py
log.level --DEBUG openflow.discovery openflow.spanning_tree
--no-flood --hold-down firewall
This will run the POX controller with the firewall.py module.
5. Test the firewall functionality:
In the Mininet terminal, run h1 ping h2
The ping should be successful
In the Mininet terminal, run h1 wget h2
The wget should fail because port 80 is blocked by the firewall.

That's it! You have created an SDN environment on Mininet and configured aswitch to
provide firewall functionality using POX controller.

You might also like