Network Bridging for WiFi-to-Ethernet in linux
Posted
by
shakaran
on Super User
See other posts from Super User
or by shakaran
Published on 2012-12-19T17:00:10Z
Indexed on
2012/12/19
17:04 UTC
Read the original article
Hit count: 437
It is possible Network Bridging for WiFi-to-Ethernet in linux instead of Ethernet-to-Ethernet?
I have a CentOS 6.3 machine. I am using KVM and I want perform a brigde for virtualize 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?
© Super User or respective owner