Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Mar 2005 17:52:35 -0700
From:      "Tom Vilot" <tom@vilot.com>
To:        Abu Khaled <khaled.abu@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Restart Networks
Message-ID:  <20050331005234.GB87058@vilot.com>
In-Reply-To: <a64c109e050330163428763399@mail.gmail.com>
References:  <001101c53588$5f4503b0$6401a8c0@GRANT> <a64c109e050330163428763399@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> > On linux variants, you can run a command like:
> > /etc/init.d/network restart
> > that will restart network serverices ie, reinitialize ifconfig setup, reload
> > IPs for a local NIC.
> > 
> > Does anyone know if there is a similar command or command set in
> > FreeBSD?

You can also try just restarting the interface. On my laptop, for
example, running FreeBSD 5.3, I re-start the ndis based network
interface thusly:

/etc/rc.d/ndis restart

where that script is:

----------------------------------------------------------------------
#!/bin/sh
# By Mario S. 2004

# PROVIDE: ndis
# KEYWORD: FreeBSD

. /etc/rc.subr

name="ndis"
start_precmd=""
stop_precmd=""
start_cmd="ndis_yastart"
stop_cmd="ndis_yastop"


ndis_yastart()
{
echo "Starting NDIS network driver: "
sysctl dev.ndis.0.SSID="myssid"
ifconfig ndis0 192.168.1.234
route add default 192.168.1.1
echo "Done"
}

ndis_yastop()
{
ifconfig ndis0 down
kldunload if_ndis
killall dhclient
}

load_rc_config $name
run_rc_command "$1"
----------------------------------------------------------------------



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