[Lxc-users] trying to bridge wireless

Serge Hallyn serge.hallyn at canonical.com
Sat Jun 4 18:11:40 UTC 2011


Quoting matthew byers (faintstlsaint at gmail.com):
> here is what i got when i ran last command:
> 
> stlsaint at stlsaint-devcore:~$ sudo /opt/bin/lxcbr0-up
> iptables v1.4.4: host/network `' not found

Oh, fudge.  The problem is I told you (in the blog post) to do

cat > file << EOF
hack hack $var hack hack
EOF

but when you do that $var gets substituted!  So your script has

	'/24'

instead of

	'${braddr}/24'

Please open /opt/bin/lxcbr0-up in an editor, clear it out, and paste in:

#!/bin/sh
# This is the address we assigned to our bridge in /etc/network/interfaces
braddr=192.168.30.1
# ip address range for containers
brrange=192.168.30.2,192.168.30.254
iptables -A FORWARD -i lxcbr0 -s ${braddr}/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE
dnsmasq --bind-interfaces --conf-file= --listen-address $braddr --except-interface lo --dhcp-range $brrange --dhcp-lease-max=253 --dhcp-no-override

Hopefully that's the last of my blog posting booboos for now, and it'll
now work for you.

-serge




More information about the lxc-users mailing list