无法连接127.0.0.1:6633远程控制器,Mininet新手求助
Hey there! Let's break down why you're getting that error message when running your Mininet script. Here are the most common issues and how to fix them:
1. Your Remote Controller Isn't Running Locally
The biggest culprit here is that the controller you're trying to connect to (like POX, OpenDaylight, or ONOS) isn't actually running on your local machine (127.0.0.1) on port 6633.
- First, start your controller:
- For POX: Run
./pox.py forwarding.l2_learningfrom the POX directory. - For OpenDaylight: Follow its official startup instructions to launch the controller service.
- For POX: Run
- Verify the controller is listening on port 6633 with this command:
You should see an entry showing the controller process actively using that port.sudo netstat -tulpn | grep 6633
2. The Controller Uses a Different Default Port
Some controllers don't use 6633 by default. For example:
- ONOS defaults to port 6653
- Older OpenDaylight versions might use 6640
Check your controller's documentation for its default OpenFlow port, then update your script's port parameter in the addController line:
net.addController( 'c0', controller=RemoteController, ip='127.0.0.1', port=YOUR_CONTROLLER_PORT )
3. Firewall is Blocking the Connection
Your local firewall might be preventing Mininet from reaching the controller on port 6633.
- Temporarily disable the firewall to test:
sudo ufw disable - If that fixes it, add a permanent rule to allow traffic on port 6633:
sudo ufw allow 6633/tcp
4. Switch Controller Configuration
Sometimes Mininet doesn't properly attach switches to the remote controller. After starting the Mininet CLI, check each switch's controller status:
mininet> sh ovs-vsctl show
Look for entries like Controller "tcp:127.0.0.1:6633" under each switch. If missing, manually attach the controller to each switch:
mininet> sh ovs-vsctl set-controller s1 tcp:127.0.0.1:6633 mininet> sh ovs-vsctl set-controller s2 tcp:127.0.0.1:6633 mininet> sh ovs-vsctl set-controller s3 tcp:127.0.0.1:6633
Once you've addressed the issue, restart your Mininet script and the error should disappear.
内容的提问来源于stack exchange,提问作者Mohammed

