3

I need to configure the network interfaces in my OpenWRT-router. hence I need to change some options in the /etc/config/network file. specifically I want to remove the bridge connection. I have tried each one of the following commands on my shell:

ifconfig lan -apbridge
ifconfig eth0 -apbridge

each command output is:

ifconfig: bad address '-apbridge'

I've tried these too:

ifconfig lan type -apbridge
ifconfig eth0 type -apbridge

each command output is:

ifconfig: bad address 'type'

I know I can just use nano editor and remove the option from the file directly, but in my case this is not practical. I need to remove the bridge connection from the command line..

how can I do that .. thanks

6
  • You should not use ifconfig any more. Get used to ip. May 6, 2014 at 12:32
  • @HaukeLaging: thank you for your reply .. but I am working from OpenWRT shell, there is no "ip" command. Besides, there is no option to remove bridge configuration using "ip" command ..
    – McLan
    May 6, 2014 at 12:36
  • You can install the package ip. Usually bridge configuration is done with brctl. May 6, 2014 at 12:48
  • @HaukeLaging: from within the OpenWRT shell, I am getting opkg_install_cmd: cannot install package ip !!
    – McLan
    May 6, 2014 at 12:55
  • Have you run opkg update first? May 6, 2014 at 12:58

1 Answer 1

1

Try brctl...

root@ap5:~# brctl --help
BusyBox v1.19.4 (2013-03-14 11:28:31 UTC) multi-call binary.

Usage: brctl COMMAND [BRIDGE [INTERFACE]]

Manage ethernet bridges

Commands:
        show                    Show a list of bridges
        addbr BRIDGE            Create BRIDGE
        delbr BRIDGE            Delete BRIDGE
        addif BRIDGE IFACE      Add IFACE to BRIDGE
        delif BRIDGE IFACE      Delete IFACE from BRIDGE
        setageing BRIDGE TIME           Set ageing time
        setfd BRIDGE TIME               Set bridge forward delay
        sethello BRIDGE TIME            Set hello time
        setmaxage BRIDGE TIME           Set max message age
        setpathcost BRIDGE COST         Set path cost
        setportprio BRIDGE PRIO         Set port priority
        setbridgeprio BRIDGE PRIO       Set bridge priority
        stp BRIDGE [1/yes/on|0/no/off]  STP on/off

root@ap5:~# brctl show
bridge name     bridge id               STP enabled     interfaces
br-lan          8000.deadc0decafe       no              eth0
                                                        wlan0

...using 'delif' you can unplug unwanted interfaces from the bridge.

If versions matter: These lines are from an "ATTITUDE ADJUSTMENT (12.09, r36088)"-box.

2
  • Thank you Yeti, but delbr and delif do not work as long as I am connected either wirelessly or through ethernet .. here is what I am following "separate the wireless and lan interface in /etc/config/network again, by default they are bridged". I want to do this line in my guidance but I can't ..
    – McLan
    May 6, 2014 at 14:22
  • when I use brctl show i can see eth0 and wlan0 in the "interfaces" column. removing the wlan0 using delif doesn't seems to have any affect when I execute cat /etc/config/network, i.e.: I can still see the br-lan bridge in my lan interface. so when using delif to remove the eth0 interface, 1\ it keeps me hanging without output, 2\ when press enter it shows me host is down .. hence I am stuck
    – McLan
    May 6, 2014 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.