Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It is possible to network bridging a WiFi-to-Ethernet link in Linux instead of Ethernet-to-Ethernet?

I have a CentOS 6.3 machine. I am using KVM and I want perform a bridge to visualize more machines. This machine is connected only via wireless connection and it doesn't have a Ethernet connection.

So, I did a bridge over the WiFi interface like:

# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE="br0"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=192.168.1.50
PREFIX=24
GATEWAY=192.168.1.1
DNS1=8.8.8.8
DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System br0"

Then I edit my wireless conection like:

# cat /etc/sysconfig/network-scripts/ifcfg-mywireless
ESSID="mywireless"
MODE=Managed
KEY_MGMT=WPA-PSK
WPA_ALLOW_WPA2=yes
CIPHER_PAIRWISE=CCMP
CIPHER_GROUP=CCMP
TYPE=Wireless
#BOOTPROTO=none
#IPADDR=192.168.1.50
#PREFIX=24
#GATEWAY=192.168.1.1
#DNS1=8.8.8.8
#DNS2=8.8.4.4
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="Auto mywireless"
UUID=874*****
ONBOOT=yes
LAST_CONNECT=1355923469
BRIDGE=br0

After, I restart the network:

# /etc/init.d/network restart
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface Auto_mywireless:  Error: Unknown connection: 874*****
                                                           [FAILED]
Bringing up interface br0:                                 [  OK  ]

But as you can see, it show a error.

My ifconfig output shows now:

# ifconfig
br0       Link encap:Ethernet  HWaddr 6E:20:AD:CE:D8:AB
          inet addr:192.168.1.50  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::6c20:adff:fece:d8ab/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:67 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:6393 (6.2 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:432 errors:0 dropped:0 overruns:0 frame:0
          TX packets:432 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:62433 (60.9 KiB)  TX bytes:62433 (60.9 KiB)

ra0       Link encap:Ethernet  HWaddr 00:22:F7:2B:87:E5
          inet addr:192.168.1.42  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::222:f7ff:fe2b:87e5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:46 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:487894880 (465.2 MiB)  TX bytes:148136473 (141.2 MiB)

virbr0    Link encap:Ethernet  HWaddr 52:54:00:5B:30:9A
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:70 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:5838 (5.7 KiB)

But this doesn't give internet connection and I loss access to 192.168.1.50. So, it is possible setup this networking bridge WiFi-to-Ethernet?

share|improve this question
    
What happens if you remove the line UUID=874***** and restart networking ? – davidgo Feb 11 '13 at 3:01
    
Same situation, no changes. – shakaran Feb 15 '13 at 1:56

Not the complete answer you are looking for (and indeed your expectation of a "full working workaround that could be reproducible 100%" seems a bit unrealistic), but after mulling over the problem a bit I think the following might help in solving your problem -

  1. It is possible to do this. I can say that as I have devices employed in the field which bridge WIFI under Linux - in fact I suspect this goes on behind the scenes with most DD-WRT and OpenWRT wifi routers.

  2. Do you know if ra0 is actually being added to the bridge ? IE what does "brctl show"?

  3. What does your route table look like ? I notice that you have used "PREFIX=24", what happens if you replace that with "NETMASK=255.255.255.0" ? (I have not seen PREFIX used before, and googling it reveals it does not always work correctly) (see http://serverfault.com/questions/304949/prefix-versus-netmask)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .