Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Nov 2009 10:56:11 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        John <comp.john@googlemail.com>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: slightly complex query - one machine with two network interfaces
Message-ID:  <4B12534B.4090809@infracaninophile.co.uk>
In-Reply-To: <20091129101652.GB48553@potato>
References:  <20091129101652.GB48553@potato>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig0B25F43CDE378DA83F8AEC0C
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

John wrote:
> Hello list, I hope you can help.
>=20
> I have a freebsd 8.0-R machine with a wired and a wireless interface.
> The wired network has real IP addresses. I want the wireless to talk to=

> the wireless network which is behind a NAT/firewall.=20
>=20
> The wireless interface on the freebsd box does not want to route
> traffic (although it would be nice if it could function as a repeater i=
f
> a wireless laptop was in the vicinity closer to it than the actual
> access point, but that's another matter). All I want the wireless
> interface on the freebsd box to do right at this moment is to talk to
> the other wireless devices. The network is 192.168.0.0/24
>=20
> Now, if I bring both interfaces up on the freebsd box, routing on that
> box turns horrible. but the routing table looks normal with 0.0.0.0
> traffic going out on the wired re0 interface. I can ping the wireless
> interface from another computer on the private network, but that's abou=
t
> it. Can anyone give me pointers on how to make the wireless interface
> more usable? basically, I want to export via either nfs or samba some
> shares to the wireless network, but routing ropiness seems to kill this=
=2E

Hmmm... this isn't a particularly complex setup really.

By bringing up your wireless i/f and assigning it an IP and netmask, you
should create a route to the directly attached network (192.168.0.0/24)=20
automatically.  Given that, you should certainly have the capability to=20
ping other hosts on that network, and they should be able to ping you.

If there isn't an entry for 192.168.0.0/24 in the output of=20

   % netstat -rn

(note: it may be printed as 192.168.0/24) then try something like this:

   # route add -net 182.168.0.0/24 -interface wlan0

wlan0 should be the correct interface on 8.0-R but other OS versions will=

probably need to substitute the particular device matching their hardware=
=2E

If that doesn't work, then please show us some real data: the output from=


   # ifconfig -a
   # netstat -rn

plus any /etc/rc.conf settings relating to ifconfig or wlan.

Once you've got the basic networking going, it's downhill from there.  Yo=
u'll
need to provide some sort of means of doing name resolution for the wirel=
ess=20
network (minimally this means adding entries to /etc/hosts, but it could =
require
fiddling with /etc/resolv.conf or other possibilities).  You need to be c=
areful
that the source address of packets you send into the wireless lan is the =
IP number
on your wlan interface otherwise hosts on the wlan will send their replie=
s out
through the NAT gateway (their default route) instead of straight back to=
 you.
By and large this will just work automatically -- there are some software=
 packages
where you can override the normal behaviour, but presumably you should kn=
ow if
you've set up anything like that.  If you suspect this is a problem, use =
tcpdump or=20
wireshark to capture and examine the traffic passing across your wlan int=
erface.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW


--------------enig0B25F43CDE378DA83F8AEC0C
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.13 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAksSU1IACgkQ8Mjk52CukIyfVwCeLxq+mY9RgtQM+YsHdFkWkX2o
jpoAn2h7QcKnPnwYevu5r1fhjh/lUtB8
=guMm
-----END PGP SIGNATURE-----

--------------enig0B25F43CDE378DA83F8AEC0C--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B12534B.4090809>