FreeBSD : Wireless Ad-hoc Networking with IP alias

Hello friends,

I'm a newbie to FreeBSD. Trying to implement a IEEE paper: Energy consumption models for ad-hoc terminals (computers).

The test setup with three computers and wireless NIC goes as follows:

Code:
Transmitter (A) -------------> Forwarder (B) --------------> Receiver (C)
10.0.1.1/24 ------------------ 10.0.1.2/24 (10.0.2.2/24) --- 10.0.2.1/24

Here laptop B acts as a forwarder. It has one wireless NIC. I use an IP alias to create a virtual NIC to forward the data to receiver. But laptop B is not forwarding the packet.

My /etc.rc.conf file is as follows:

Laptop A (Transmitter):
Code:
wlans_ath0="wlan0"
create_args_wlan0="wlanmode adhoc"
ifconfig_wlan0="inet 10.0.1.1 netmask 255.255.255.0 ssid energy"

Laptop B (Forwarder):
Code:
wlans_ath0="wlan0"
create_args_wlan0="wlanmode adhoc"
ifconfig_wlan0="inet 10.0.1.1 netmask 255.255.255.0 ssid energy"
ifconfig_wlan0_alias0="inet 10.0.2.2 netmask 255.255.255.0 ssid energy"

Laptop C (Receiver):
Code:
wlans_ath0="wlan0"
create_args_wlan0="wlanmode adhoc"
ifconfig_wlan0="inet 10.0.2.1 netmask 255.255.255.0 ssid energy"

Can some one tell me why laptop B is not forwarding the packets? Thanks in advance.
 
Add to /etc/rc.conf on the forwarding machine:
Code:
gateway_enable="YES"

This turns on routing, which is disabled by default.
 
Hello friend,

Thanks for your reply.. After adding
Code:
gateway_enable="YES"
into my /etc/rc.conf, it didn't work. Then I added
Code:
defaultrouter=10.0.1.2
in Host A. Then it started transferring the data. Please confirm, is it correct or not? Thanks for your kind, swift reply.

I want to transfer the data @ 2Mbps throughput between Host A and Host C. How to do this in FreeBSD? How to fix or specify the throughput? Thanks in advance.
 
Both host A and C will need a default gateway, and it will point to their respective addresses on host B.

The default gateway is used when the destination address isn't found on the local (sub)network. The packet will get sent to the default gateway which in turn will try and figure out where to route it next.

I assume you want to prioritize or limit the traffic going in/out of host B? This can be done with IPFW/Dummynet or PF/ALTQ.
 
Back
Top