problem with gateway and route

Dear friends;

There are two network cards: re0 and wlan0. I just want to set up my server to be a wireless rourer with subnet 192.168.1.1/24 based on wlan0 also, so I add following words in /etc/rc.conf:

Code:
ifconfig_wlan0="inet 192.168.1.1 netmask 255.255.255.0 ssid concordfamily mode 11n channel"
wlans_rt28600="wlan0"
router_enable="YES"
static_routes="internalnet1 internalnet2 net1 net2"
route_internalnet2="-net 192.168.1.0/24 192.168.0.6"
route_internalnet1="-net 192.168.1.0/24 192.168.1.1"
ifconfig_re0="inet 192.168.0.6  netmask 255.255.255.0"
defaultrouter="192.168.0.1"
gateway_enable="YES"

But when booting, system says gateway 192.168.1.1 unreachable, and if I:
Code:
ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
ping: sendto: Host is down
ping: sendto: Host is down
ping: sendto: Host is down
ping: sendto: Host is down

What does it mean? And what shall I do?

Thanks!
 
You don't need dynamic routing protocol or static routes. This will suffice:

Code:
ifconfig_wlan0="inet 192.168.1.1 netmask 255.255.255.0 ssid concordfamily mode 11n channel"
wlans_rt28600="wlan0"
ifconfig_re0="inet 192.168.0.6 netmask 255.255.255.0"
defaultrouter="192.168.0.1"
gateway_enable="YES"

It's the other router sitting at 192.168.0.1 that needs to know how to reach wireless network, and vice versa.

But first make sure you have wireless connection working.

http://www.freebsd.org/doc/handbook/network-routing.html
http://www.freebsd.org/doc/handbook/network-wireless.html
 
Besides this would be a gross error because you can't have two otherwise identical routes that have different gateway addresses:

Code:
route_internalnet2="-net 192.168.1.0/24 192.168.0.6"
route_internalnet1="-net 192.168.1.0/24 192.168.1.1"
 
It's not that load balancing is not possible, it's that next-hop IP is IP of his interface, nor it makes any sense in his setup.

But, it will be confusing as it is.
 
Thanks bbzz and kpa. I have # the 2 lines:

Code:
#router_enable="YES"
#route_inrenalnet1="-net 192.168.1.0/24 192.168.1.1"

but still can't assign IP address to wlan0 by sysinstall and of course can't ping 192.168.1.1 also.

By the way, how to config 192.168.1.1 as default router of 192.168.1.0/24?

Thanks!
 
bbzz said:
You didn't read those links I posted, did you?
There's no sense continuing unless you did.

Yes, I have read the 2 links and put:

Code:
create_args_wlan0="wlanmode hostap"

into /etc/rc.conf. I can assign 192.168.1.1 to wlan0 right now. But SSID stays on desktop's screen just several seconds, and then goes away.

Thanks.
 
Put:

Code:
dhcpd_enable="YES"
dhcpd_ifaces="wlan0"
defaultrouter="192.168.0.1"
defaultrouter="192.168.1.1"

into /etc/rc.conf then SSID stay there. but connection restricted,even no any encryption. and I wonder why 2 defaultrouters allow me to assign 192.168.1.1 to wlan0.

Still need help
 
Remove both default gateways. You don't need them. Remove those static routes too. You also don't need those. Both networks are 'directly' connected and thus their route is implied.
 
Thanks SirDice. I will try. The problem is from dhcpd:

Code:
 /usr/local/etc/rc.d/isc-dhcpd restart
dhcpd not running? (check /var/run/dhcpd/dhcpd.pid).
Starting dhcpd.
Internet Systems Consortium DHCP Server V3.1-ESV
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Wrote 0 class decls to leases file.
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.
wlan0: not found
/usr/local/etc/rc.d/isc-dhcpd: WARNING: failed to start dhcpd

But wlan0 is there.
 
SirDice said:
Can you post your current rc.conf?

Thanks for your help. /etc/rc.conf is:

Code:
keymap="us.iso"
moused_enable="YES"
saver="daemon"
keyrate="normal"
sshd_enable="YES"
#named_enable="YES"
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
postfix_enable="YES"
accf_data_load="YES"
accf_http_load="YES"
apache22_enable="YES"
apache22_data_accept_enable="YES"
apache22_http_accept_enable="YES"
apache22ssl_enable="YES"
mysql_enable="YES"
courier_authdaemond_enable="YES"
courier_imap_imapd_enable="YES"
courier_imap_imapd_ssl_enable="YES"
courier_imap_pop3d_enable="YES"
courier_imap_pop3d_ssl_enable="YES"
amavisd_enable="YES"
amavis_milter_enable="YES"
#amavis_p0fanalyser_enable="YES"
#amavis_p0fanalyser_p0f_filter="tcp dst port 25"
clamav_clamd_enable="YES"
clamav_freshclam_enable="YES"
spamd_enable="YES"
webmin_enable="YES"
snmpd_enable="YES"
snmpd_flags="-a"
snmptrapd_enable="YES"
snmptrapd_flags="-a -p /var/run/snmptrapd.pid"
snmpd_conffile="/usr/local/share/snmp/snmpd.conf /etc/snmpd.conf"
#mrtg_daemon_enable="YES"
#nfsuserd_enable="YES"
#nfscbd_enable="YES"
#gssd_enable="YES"
inetd_enable="YES"
wlans_rt28600="wlan0"
#router_enable="YES"
static_routes="internalnet1 internalnet2"
route_internalnet2="-net 192.168.1.0/24 192.168.0.6"
#route_internalnet2="-default 192.168.1.1"
dhcpd_enable="YES"
dhcpd_ifaces="wlan0"
create_args_wlan0="wlanmode hostap"
#hostapd_enable="YES"

ifconfig_re0="inet 192.168.0.6 netmask 255.255.255.0"
#defaultrouter="192.168.0.1"
#defaultrouter="192.168.1.1"
hostname="xxx.xxx.xxx.xxx"
gateway_enable="YES"
ifconfig_wlan0="inet 192.168.1.1  netmask 255.255.255.0 ssid concordfamily mode 11n channel 1"
 
Remove the static routes. You still have one.

These are supposed to go in /boot/loader.conf:
Code:
accf_data_load="YES"
accf_http_load="YES"
 
Thanks, rc.conf looks much better. But dhcpd still can't be started as before. The problem is wlan0 can't be found by it.
 
Does the interface come up correctly? The DHCP daemon might be starting before the interface is completely initialized.
 
SirDice said:
Does the interface come up correctly? The DHCP daemon might be starting before the interface is completely initialized.

The wireless card comes up correctly. And when booting, wlan0 appears before dhcpd. So what shall I do? Even cp the module into /boot/kernel/ is no good.
 
Problem sovled. Should be 11g instead of 11n, and all static routes should be erased. Thank you all.
 
Perfect. Do you also understand why you don't need static routes?
 
No, it's because those networks are so-called 'directly connected'. Just have a look at your current routing table. You'll see the routes already exist.

If you have an interface in 192.168.1.0/24, that route will be automatically added. When a router routes packets it only looks at the destination address of the packet. When packet is destined for a 192.168.1.0/24 address it'll see it can reach that network on one of it's own interfaces. You only need to add routes if it can't figure out where the next hop would be.
 
Code:
netstat -r
Routing tables

Internet:
Destination Gateway Flags Refs Use Netif Expire
localhost link#8 UH 0 1366 lo0
192.168.0.0 link#1 U 0 265 re0
192.168.0.6 link#1 UHS 0 0 lo0
192.168.1.0 link#9 U 0 256 wlan0
asus link#9 UHS 0 0 lo0
 
Back
Top