[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ethernet and wifi together



On Mon, Feb 24, 2014 at 03:32:08PM +0100, S3v3ran . wrote:
> Hello
> 
> My scenario is the following. I'm connected to the wired network, which is
> the default network i'm using. The default gateway, DNS server and
> everything else is via this interface. On the other side i have some
> virtual machines inside and i need them to use the bridged wifi connection
> (because the wired one is behind a proxy server). For this i also need to
> have connected the wireless network (using WPA2-PSK). When i use Wicd. When
> i use Wicd to connect to wifi, it automatically disconnects me from
> ethernet and when i connect to ethernet, it disconnects me from wifi. Both
> connections (wifi and wired) should be configured dynamically (i'm using
> various networks at home or in the company). I tried a network-manager but
> I couldn't connect to wifi with it. Is there a way how to connect
> dynamically to both interfaces, using the eth0 as default route? Thanks in
> advance.
> 
> Severan


I had a similar problem, and I will get to it in a second.
But first: bridged Wifi might not work. Some AP refuse to accept packages,
which are not from the interface bound to it. So you would have to
masquerade those packages with ebtables.

Here how I did it.
I created a dummy-bridge which is completely internal

in /etc/network/interfaces

...
iface dummy0 inet manual

auto br0
iface br0 inet static
        address 10.0.77.1
        network 10.0.77.0
        netmask 255.255.255.0
        broadcast 10.0.77.255
        bridge_ports dummy0
        bridge_stp yes
        post-up /bin/echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up /sbin/iptables --table filter --insert INPUT --source \
10.0.77.0/255.255.255.0 -j ACCEPT
        post-up /sbin/iptables --table filter --insert FORWARD --source \
10.0.77.0/255.255.255.0 -j ACCEPT
        post-up /sbin/iptables --table filter --insert FORWARD \
--destination 10.0.77.0/255.255.255.0 --match state --state \
ESTABLISHED,RELATED -j ACCEPT
        post-up /sbin/iptables --table nat --insert POSTROUTING --source \
10.0.77.0/255.255.255.0 ! --destination 10.0.77.0/255.255.255.0 -j \
MASQUERADE
        pre-down /sbin/iptables --table filter --delete INPUT --source \
10.0.77.0/255.255.255.0 -j ACCEPT
        pre-down /sbin/iptables --table filter --delete FORWARD --source \
10.0.77.0/255.255.255.0 -j ACCEPT
        pre-down /sbin/iptables --table filter --delete FORWARD \
--destination 10.0.77.0/255.255.255.0 --match state --state
ESTABLISHED,RELATED -j ACCEPT
        pre-down /sbin/iptables --table nat --delete POSTROUTING --source \
10.0.77.0/255.255.255.0 ! --destination 10.0.77.0/255.255.255.0 -j \
MASQUERADE

...

So 10.0.77.0/24 is my xen network for all my virtual domains.
It just will work with the default vif-bridge script. 

I also use dnsmasq to serve all virtual machines with a proxy dns server.

Then I agree with my previous poster. Get rid of any network manager.
Install wpasupplicant for your wifi and manage the ethernet with
resolvconf.




-H


-- 
Henning Follmann           | hfollmann@itcfollmann.com


Reply to: