How to stop Wireless AP Hosting using Network Manager on Ubuntu?

14,101

You have to remove interfaces from the vbridge before it can be deleted. These commands should do it:

killall hostapd  
brctl delif br0 eth0  
brctl delif br0 wlan0  
ifconfig br0 down  
brctl delbr br0  
service networking restart  
Share:
14,101

Related videos on Youtube

nixnotwin
Author by

nixnotwin

Updated on September 17, 2022

Comments

  • nixnotwin
    nixnotwin over 1 year

    I use the following script to make my netbook a full-fledged wireless access point. It creates a bridge with eth0 and wlan0 and starts hostapd.

    #!/bin/bash
    
    service network-manager stop 
    ifconfig eth0 0.0.0.0 #remove IP from eth0
    ifconfig eth0 up #ensure the interface is up
    
    ifconfig wlan0 0.0.0.0 #remove IP from eth1
    ifconfig wlan0 up #ensure the interface is up
    
    brctl addbr br0 #create br0 node
    hostapd -d /etc/hostapd/hostapd.conf > /var/log/hostapd.log &
    sleep 5
    brctl addif br0 eth0 #add eth0 to bridge br0
    brctl addif br0 wlan0 #add wlan0 to bridge br0
    
    ifconfig br0 192.168.1.15 netmask 255.255.255.0 #ip for bridge
    ifconfig br0 up #bring up interface
    route add default gw 192.168.1.1 # gateway
    

    This script works efficiently. But if I want to revert back to use Network Manager, I cannot do it. The bridge simply cannot be deleted. How can I modify this script so that if I run bridge_script --stop, the bridge gets deleted, network manager starts and interfaces behave as if the machine had a fresh reboot.

  • nixnotwin
    nixnotwin over 13 years
    No,didn't work. The interfaces are removed but it shows that bridge cannot be removed.
  • RobotHumans
    RobotHumans over 13 years
    are you root? try dropping the br0 interface before you delete it...editing
  • nixnotwin
    nixnotwin over 13 years
    Thanks. Now I can turn my netbook into a wireless AP, as quickly as it can be made a normal wreless client. Also all my wireless devises have become useful once more.