Re: IP bridge was briefly working now is not, OpenBSD 4.8, amd64, bridge from PC wifi to Beagleboard

2010-12-21 Thread Stuart Henderson
On 2010-12-20, brett brett.ma...@gmail.com wrote:
 On the OpenBSD PC I created a bridge:

 # ifconfig nfe0 inet 192.168.10.12 netmask 255.255.255.0
 # ifconfig bridge0 create
 In /etc/hostname.nfe0 is the single word: up
 In /etc/hostname.otus0 is the single word: up
 In /etc/bridgename.bridge0 is: add nfe0 add otus0 up

You must use either WDS or hostap to bridge 802.11 interfaces
to wired interfaces, there are not spaces for enough MAC addresses
in the standard 802.11 frames to handle bridging. (OpenBSD doesn't
support WDS).

Some commercial wireless devices support a 'client-bridge' mode
without WDS; this uses something which can basically be described
as a layer-2 NAT.

To do this using OpenBSD I would suggest just doing standard
layer-3 NAT with PF and dhcpd instead.

 I am not sure why it worked before

Nor am I.



Re: IP bridge was briefly working now is not, OpenBSD 4.8, amd64, bridge from PC wifi to Beagleboard

2010-12-21 Thread brett mm
On 22 December 2010 10:26, Stuart Henderson s...@spacehopper.org wrote:
 On 2010-12-20, brett brett.ma...@gmail.com wrote:
 On the OpenBSD PC I created a bridge:

 # ifconfig nfe0 inet 192.168.10.12 netmask 255.255.255.0
 # ifconfig bridge0 create
 In /etc/hostname.nfe0 is the single word: up
 In /etc/hostname.otus0 is the single word: up
 In /etc/bridgename.bridge0 is: add nfe0 add otus0 up

 You must use either WDS or hostap to bridge 802.11 interfaces
 to wired interfaces, there are not spaces for enough MAC addresses
 in the standard 802.11 frames to handle bridging. (OpenBSD doesn't
 support WDS).

 Some commercial wireless devices support a 'client-bridge' mode
 without WDS; this uses something which can basically be described
 as a layer-2 NAT.

 To do this using OpenBSD I would suggest just doing standard
 layer-3 NAT with PF and dhcpd instead.

 I am not sure why it worked before

 Nor am I.

Thanks for the help, everyone. I am traveling so will try these
suggestions in a week or two when I get home. Silence means successful
execution, otherwise I'll be back!
Merry xmas to question answerers and the OpenBSD team!



IP bridge was briefly working now is not, OpenBSD 4.8, amd64, bridge from PC wifi to Beagleboard

2010-12-20 Thread brett
Hi @misc,
I have a Beagleboard-xM with Ansgtrom Linux and a PC running OpenBSD 4.8, AMD64 
version. My PC is connected via TP-Link wifi to household router (my otus0 
internet address for this connection is 192.168.1.101). The beagleboard is 
connected to the PC via ethernet.
On the Beagle I configured the ethernet device (which shows up as usb0 on 
Angstrom):

# ifconfig usb0 inet 192.168.10.10 netmask 255.255.255.0
# route add default gw 192.168.10.12 netmask 255.255.255.0 dev usb0
Also, in /etc/resolv.conf I added nameservers 203.12.160.35  203.12.160.36

On the OpenBSD PC I created a bridge:

# ifconfig nfe0 inet 192.168.10.12 netmask 255.255.255.0
# ifconfig bridge0 create
In /etc/hostname.nfe0 is the single word: up
In /etc/hostname.otus0 is the single word: up
In /etc/bridgename.bridge0 is: add nfe0 add otus0 up
In /etc/sysctl.conf I uncommented: net.inet.ip.forwarding=1

I have also tried uncommenting net.inet6.ip6.mforwarding=1 but it did not help.

I can ping 192.168.10.12 from the Beagle, and 192.168.10.10 from the PC, but I 
cannot ping 192.168.1.101 (the PC's wifi connection from the Beagle, network 
is unreachable).
The first time I set this up (a few days ago), I could ping the outside world 
from the Beagle running Angstrom. I loaded Ubuntu onto the Beagle tried the 
setup again, and could not reach the outside internet. Now I've gone back to 
Angstrom and cannot get the connection to come back up. I am not sure why it 
worked before and not now but it seems like my OpenBSD bridge0 is not working. 
When it was working, typing ifconfig (as below) I seem to remember the output 
for bridge0 was longer than it is now, but am not sure. Probably it is some 
simple forgotten command but I do not know what it could be.

Thanks for any help!
Brett.

More detailed output:


On the OpenBSD pc:

# ifconfig nfe0 inet 192.168.10.12 netmask 255.255.255.0
# ifconfig bridge0 create
# ifconfig   
lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST mtu 33160
priority: 0
groups: lo
inet 127.0.0.1 netmask 0xff00
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
re0: flags=8802BROADCAST,SIMPLEX,MULTICAST mtu 1500
lladdr c8:3a:35:d4:64:2b
priority: 0
media: Ethernet autoselect (10baseT half-duplex)
status: no carrier
nfe0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
lladdr 00:25:11:1e:44:93
priority: 0
media: Ethernet autoselect (100baseTX full-duplex)
status: active
inet6 fe80::225:11ff:fe1e:4493%nfe0 prefixlen 64 scopeid 0x2
inet 192.168.10.12 netmask 0xff00 broadcast 192.168.10.255
enc0: flags=0
priority: 0
groups: enc
status: active
pflog0: flags=141UP,RUNNING,PROMISC mtu 33160
priority: 0
groups: pflog
otus0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
lladdr d8:5d:4c:8e:b8:29
priority: 4
groups: wlan egress
media: IEEE802.11 autoselect (OFDM54 mode 11g)
status: active
ieee80211: nwid linksys_hd chan 3 bssid 00:25:9c:83:5f:94 34dB wpapsk 
0x075ce6504c26846e32c144a71a0f7840988b9a8e9d4a7593243d4dfae845032e wpaprotos 
wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip
inet6 fe80::da5d:4cff:fe8e:b829%otus0 prefixlen 64 scopeid 0x7
inet 192.168.1.101 netmask 0xff00 broadcast 192.168.1.255
bridge0: flags=0
groups: bridge
priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp
-
# route show
Routing tables

Internet:
DestinationGatewayFlags   Refs  Use   Mtu  Prio Iface
default192-168-1-1.tpgi.c UGS   36   996265 -12 otus0
CPE-58-169-237-189 192-168-1-1.tpgi.c UGHD   1   996074 - L  56 otus0
124-168-64-155.dyn 192-168-1-1.tpgi.c UGHD   1   991997 - L  56 otus0
loopback   localhost  UGRS   00 33160 8 lo0  
localhost  localhost  UH 2   66 33160 4 lo0  
192.168.1/24   link#7 UC 10 - 4 otus0
192-168-1-1.tpgi.c 00:25:9c:83:5f:93  UHLc   30 - 4 otus0
192-168-1-101.tpgi localhost  UGHS   00 33160 8 lo0  
192.168.10/24  link#2 UC 10 - 4 nfe0 
192.168.10.10  32:45:70:13:d5:3e  UHLc   06 - 4 nfe0 
BASE-ADDRESS.MCAST localhost  URS03 33160 8 lo0  

Internet6:
DestinationGatewayFlags   Refs  Use   Mtu  Prio Iface
::/104 localhost  UGRS   00 - 8 lo0  
::/96  localhost  UGRS   00 - 8 lo0  
localhost  localhost  UH 

Re: IP bridge was briefly working now is not, OpenBSD 4.8, amd64, bridge from PC wifi to Beagleboard

2010-12-20 Thread AlanCF
On Mon, Dec 20, 2010 at 3:20 PM, brett brett.ma...@gmail.com wrote:
 Hi @misc,
 I have a Beagleboard-xM with Ansgtrom Linux and a PC running OpenBSD 4.8,
AMD64 version. My PC is connected via TP-Link wifi to household router (my
otus0 internet address for this connection is 192.168.1.101). The beagleboard
is connected to the PC via ethernet.
 On the Beagle I configured the ethernet device (which shows up as usb0 on
Angstrom):

 # ifconfig usb0 inet 192.168.10.10 netmask 255.255.255.0
 # route add default gw 192.168.10.12 netmask 255.255.255.0 dev usb0
 Also, in /etc/resolv.conf I added nameservers 203.12.160.35  203.12.160.36

 On the OpenBSD PC I created a bridge:

 # ifconfig nfe0 inet 192.168.10.12 netmask 255.255.255.0
 # ifconfig bridge0 create
 In /etc/hostname.nfe0 is the single word: up
 In /etc/hostname.otus0 is the single word: up
 In /etc/bridgename.bridge0 is: add nfe0 add otus0 up
 In /etc/sysctl.conf I uncommented: net.inet.ip.forwarding=1

 I have also tried uncommenting net.inet6.ip6.mforwarding=1 but it did not
help.

 I can ping 192.168.10.12 from the Beagle, and 192.168.10.10 from the PC, but
I cannot ping 192.168.1.101 (the PC's wifi connection from the Beagle,
network is unreachable).
 The first time I set this up (a few days ago), I could ping the outside
world from the Beagle running Angstrom. I loaded Ubuntu onto the Beagle tried
the setup again, and could not reach the outside internet. Now I've gone back
to Angstrom and cannot get the connection to come back up. I am not sure why
it worked before and not now but it seems like my OpenBSD bridge0 is not
working. When it was working, typing ifconfig (as below) I seem to remember
the output for bridge0 was longer than it is now, but am not sure. Probably it
is some simple forgotten command but I do not know what it could be.

 Thanks for any help!
 Brett.

 More detailed output:

 
 On the OpenBSD pc:

 # ifconfig nfe0 inet 192.168.10.12 netmask 255.255.255.0
 # ifconfig bridge0 create
 # ifconfig
 lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST mtu 33160
priority: 0
groups: lo
inet 127.0.0.1 netmask 0xff00
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
 re0: flags=8802BROADCAST,SIMPLEX,MULTICAST mtu 1500
lladdr c8:3a:35:d4:64:2b
priority: 0
media: Ethernet autoselect (10baseT half-duplex)
status: no carrier
 nfe0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
lladdr 00:25:11:1e:44:93
priority: 0
media: Ethernet autoselect (100baseTX full-duplex)
status: active
inet6 fe80::225:11ff:fe1e:4493%nfe0 prefixlen 64 scopeid 0x2
inet 192.168.10.12 netmask 0xff00 broadcast 192.168.10.255
 enc0: flags=0
priority: 0
groups: enc
status: active
 pflog0: flags=141UP,RUNNING,PROMISC mtu 33160
priority: 0
groups: pflog
 otus0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
lladdr d8:5d:4c:8e:b8:29
priority: 4
groups: wlan egress
media: IEEE802.11 autoselect (OFDM54 mode 11g)
status: active
ieee80211: nwid linksys_hd chan 3 bssid 00:25:9c:83:5f:94 34dB wpapsk
0x075ce6504c26846e32c144a71a0f7840988b9a8e9d4a7593243d4dfae845032e wpaprotos
wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip
inet6 fe80::da5d:4cff:fe8e:b829%otus0 prefixlen 64 scopeid 0x7
inet 192.168.1.101 netmask 0xff00 broadcast 192.168.1.255
 bridge0: flags=0
groups: bridge
priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto
rstp

-
 # route show
 Routing tables

 Internet:
 DestinationGatewayFlags   Refs  Use   Mtu  Prio
Iface
 default192-168-1-1.tpgi.c UGS   36   996265 -12
otus0
 CPE-58-169-237-189 192-168-1-1.tpgi.c UGHD   1   996074 - L  56
otus0
 124-168-64-155.dyn 192-168-1-1.tpgi.c UGHD   1   991997 - L  56
otus0
 loopback   localhost  UGRS   00 33160 8 lo0
 localhost  localhost  UH 2   66 33160 4 lo0
 192.168.1/24   link#7 UC 10 - 4
otus0
 192-168-1-1.tpgi.c 00:25:9c:83:5f:93  UHLc   30 - 4
otus0
 192-168-1-101.tpgi localhost  UGHS   00 33160 8 lo0
 192.168.10/24  link#2 UC 10 - 4
nfe0
 192.168.10.10  32:45:70:13:d5:3e  UHLc   06 - 4
nfe0
 BASE-ADDRESS.MCAST localhost  URS03 33160 8 lo0

 Internet6:
 DestinationGatewayFlags   Refs  Use   Mtu  Prio
Iface
 ::/104 localhost  UGRS   00 - 8 lo0
 ::/96  localhost  UGRS   00 - 8 

Re: IP bridge was briefly working now is not, OpenBSD 4.8, amd64, bridge from PC wifi to Beagleboard

2010-12-20 Thread brett
  I can ping 192.168.10.12 from the Beagle, and 192.168.10.10 from the PC, but
 I cannot ping 192.168.1.101 (the PC's wifi connection from the Beagle,
 network is unreachable).
  The first time I set this up (a few days ago), I could ping the outside
 world from the Beagle running Angstrom. I loaded Ubuntu onto the Beagle tried
 the setup again, and could not reach the outside internet. Now I've gone back
 to Angstrom and cannot get the connection to come back up. I am not sure why
 it worked before and not now but it seems like my OpenBSD bridge0 is not
 working. When it was working, typing ifconfig (as below) I seem to remember
 the output for bridge0 was longer than it is now, but am not sure. Probably it
 is some simple forgotten command but I do not know what it could be.
 

  r...@beagleboard:~# ping 192.168.1.101
  connect: Network is unreachable
  r...@beagleboard:~# route
  Kernel IP routing table
  Destination Gateway Genmask Flags Metric RefUse
 Iface
  default 192.168.10.12   255.255.255.0   UG0  00
 usb0
  192.168.10.0*   255.255.255.0   U 0  00
 usb0
 
 
 -
 -
 
 
 
 If a DHCP server is on the 192.168.1.0/24 block, you could configure
 your beagleboard to get an address through DHCP, since you set up the
 bridge.
 
 If you're using a bridge, you don't need to set
 net.inet.ip.forwarding to 1, as you aren't actually routing packets,
 you're bridging them.
 (see http://www.openbsd.org/faq/faq6.html#Bridge)
 
 --AlanCF
 

But since the 192.168.1.0 network is unreachable I don't think the dhcp
request would get through anyway



Re: IP bridge was briefly working now is not, OpenBSD 4.8, amd64, bridge from PC wifi to Beagleboard

2010-12-20 Thread AlanCF
I think it's only saying that because your current configuration (static IP)
isn't routing through to the network (you'd have to reconfigure both routers
more). So, instead of trying to route the packets, you could just bridge
them, and use DHCP to get an address from your 192.168.1.0/24 router.

--AlanCF

On Dec 20, 2010 4:19 PM, brett brett.ma...@gmail.com wrote:

   I can ping 192.168.10.12 from the Beagle, and 192.168.10.10 from the
PC, but
  I cannot ping 192.168.1.101 (the PC's wifi connection from the Beagle,
  network is unreachable).
   The first time I set this up (a few days ago), I could ping the
outside
  world from the Beagle running Angstrom. I loaded Ubuntu onto the Beagle
tried
  the setup again, and could not reach the outside internet. Now I've gone
back
  to Angstrom and cannot get the connection to come back up. I am not sure
why
  it worked before and not now but it seems like my OpenBSD bridge0 is not
  working. When it was working, typing ifconfig (as below) I seem to
remember
  the output for bridge0 was longer than it is now, but am not sure.
Probably it
  is some simple forgotten command but I do not know what it could be.
  

   r...@beagleboard:~# ping 192.168.1.101
   connect: Network is unreachable
   r...@beagleboard:~# route
   Kernel IP routing table
   Destination Gateway Genmask Flags Metric Ref
 Use
  Iface
   default 192.168.10.12   255.255.255.0   UG0  0
 0
  usb0
   192.168.10.0*   255.255.255.0   U 0  0
 0
  usb0
  
  
 
-
  -
  
  
 
  If a DHCP server is on the 192.168.1.0/24 block, you could configure
  your beagleboard to get an address through DHCP, since you set up the
  bridge.
 
  If you're using a bridge, you don't need to set
  net.inet.ip.forwarding to 1, as you aren't actually routing packets,
  you're bridging them.
  (see http://www.openbsd.org/faq/faq6.html#Bridge)
 
  --AlanCF
 

 But since the 192.168.1.0 network is unreachable I don't think the dhcp
 request would get through anyway



Re: IP bridge was briefly working now is not, OpenBSD 4.8, amd64, bridge from PC wifi to Beagleboard

2010-12-20 Thread Jon Simola
On Mon, Dec 20, 2010 at 3:20 PM, brett brett.ma...@gmail.com wrote:

 r...@beagleboard:~# route add default gw 192.168.10.12 netmask 255.255.255.0
dev
  usb0

Don't set a netmask on your default route. You're adding a route for
0.0.0.0/24.

 r...@beagleboard:~# route
 Kernel IP routing table
 Destination Gateway Genmask Flags Metric RefUse
Iface
 default 192.168.10.12   255.255.255.0   UG0  00
usb0
 192.168.10.0*   255.255.255.0   U 0  00
usb0

Shows up right there on the default line.

A default route should have a Genmask of 0.0.0.0 (says so in the man page).

All the IRB/CRB nonsense is just distracting.

--
Jon



Re: IP bridge was briefly working now is not, OpenBSD 4.8, amd64, bridge from PC wifi to Beagleboard

2010-12-20 Thread AlanCF
On Mon, Dec 20, 2010 at 5:45 PM, Jon Simola jsim...@gmail.com wrote:
 On Mon, Dec 20, 2010 at 3:20 PM, brett brett.ma...@gmail.com wrote:

 r...@beagleboard:~# route add default gw 192.168.10.12 netmask
255.255.255.0
 dev
  usb0

 Don't set a netmask on your default route. You're adding a route for
 0.0.0.0/24.

 r...@beagleboard:~# route
 Kernel IP routing table
 Destination Gateway Genmask Flags Metric RefUse
 Iface
 default 192.168.10.12   255.255.255.0   UG0  00
 usb0
 192.168.10.0*   255.255.255.0   U 0  00
 usb0

 Shows up right there on the default line.

 A default route should have a Genmask of 0.0.0.0 (says so in the man page).
If you were to do routing, and wanted to use a seperate block of
addresses (from 192.168.1.0/24), besides the Linux box's config, and
the OpenBSD box's config, you'd have to modify the configuration in
192.168.1.0/24 's router with static routes to the OpenBSD box (most
SOHO routers don't support this). If you were to try to use some
addresses under the 192.168.1.0/24 block, you'd have to either add a
static route, or do ARP proxying at the OpenBSD box.

 All the IRB/CRB nonsense is just distracting.
In my opinion, bridging is the most efficient way of accomplishing the
task (getting acccess to the wireless network through a computer
running OpenBSD)

 --
 Jon



--AlanCF