slightly complex query - one machine with two network interfaces

Matthew Seaman m.seaman at infracaninophile.co.uk
Sun Nov 29 10:56:30 UTC 2009


John wrote:
> Hello list, I hope you can help.
> 
> 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. 
> 
> 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 if
> 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
> 
> 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 about
> 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.

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) 
automatically.  Given that, you should certainly have the capability to 
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 

   % 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.

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.  You'll
need to provide some sort of means of doing name resolution for the wireless 
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 careful
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 replies 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 know if
you've set up anything like that.  If you suspect this is a problem, use tcpdump or 
wireshark to capture and examine the traffic passing across your wlan interface.

	Cheers,

	Matthew

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20091129/2d9dbde8/signature.pgp


More information about the freebsd-questions mailing list