DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 3rd September 2008
rex rex is offline
Real Name: Nikhil Rathod
Shell Scout
 
Join Date: May 2008
Location: Chicago
Posts: 114
Thanked 2 Times in 2 Posts
Default Activating/deactivating Ethernet card

Guys is there a way of activating and deactivating Ethernet card on freebsd from command prompt. Actually I need to test something for which I need to activate and deactivate Ethernet link again and again. So I'll be writing a script for that but first I need to know how to do this from command prompt.
Reply With Quote
  #2   (View Single Post)  
Old 3rd September 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Yes, most definately.

Bring the interface down:
% ifconfig xx0 down

Bring it up:
% ifconfig xx0 up

Pretty basic stuff, could have learnt this by reading the man page..
Quote:
Originally Posted by ifconfig(8)
down - Mark an interface ``down''. When an interface is marked ``down'', the system will not attempt to transmit messages through that interface. If possible, the interface will be reset to disable reception as well. This action does not automatically disable routes using the interface.
...
up - Mark an interface ``up''. This may be used to enable an interface after an ``ifconfig down''. It happens automatically when setting the first address on an interface. If the interface was reset when previously marked down, the hardware will be re-initialized.
Have fun.
Reply With Quote
  #3   (View Single Post)  
Old 3rd September 2008
18Googol2's Avatar
18Googol2 18Googol2 is offline
Real Name: whoami
Spam Deminer
 
Join Date: Apr 2008
Location: pwd
Posts: 283
Thanked 20 Times in 18 Posts
Default

ifconfig is standard ultility, you may also wanna check out netif script. The equivalent commands are:

/etc/rc.d/netif network_card stop

/etc/rc.d/netif network_card start

Quote:
ifconfig xx0 down
He may have more than 1 identical physical network card, multiple loopback devices, multiple tunnel...
Reply With Quote
  #4   (View Single Post)  
Old 3rd September 2008
jleal jleal is offline
Real Name: Chuy
Port Guard
 
Join Date: May 2008
Location: Boca del Rio
Posts: 11
Thanked 1 Time in 1 Post
Default netstart

you may also want to restart your entire network config

try typing :

/etc/netstart

Reply With Quote
  #5   (View Single Post)  
Old 3rd September 2008
rex rex is offline
Real Name: Nikhil Rathod
Shell Scout
 
Join Date: May 2008
Location: Chicago
Posts: 114
Thanked 2 Times in 2 Posts
Default

Quote:
Pretty basic stuff, could have learnt this by reading the man page
I did, but didn't scroll down that far... my bad.
Thanks to all for the tips. I'll note it down for future refrence.
Reply With Quote
  #6   (View Single Post)  
Old 4th September 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

Quote:
Originally Posted by jleal View Post
you may also want to restart your entire network config

try typing :

/etc/netstart

If you're on FreeBSD 6+, you should stop using netstart. Use /etc/rc.d/netif instead.

Quote:
Originally Posted by 18Googol2
ifconfig is standard ultility, you may also wanna check out netif script. The equivalent commands are:

/etc/rc.d/netif network_card stop
/etc/rc.d/netif network_card start
The syntax is actually /etc/rc.d/netif <action> <interface>, where <interface> is optional (omit it to perform <action> on all network interfaces).
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
  #7   (View Single Post)  
Old 4th September 2008
tuck's Avatar
tuck tuck is offline
Shell Scout
 
Join Date: May 2008
Posts: 99
Thanked 14 Times in 6 Posts
Default

If you have a problem with the routing tables after shutting down the nic with e.g. ifconfig *nic* down
try ifconfig *nic* -alias (or delete)
The manpage describes the deletion of the aliases but that's not only for aliases.
Just in case you have a problem after shutting down one nic and activating another nic.
Reply With Quote
  #8   (View Single Post)  
Old 4th September 2008
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 446
Thanked 69 Times in 46 Posts
Default

Quote:
Originally Posted by rex
Actually I need to test something for which I need to activate and deactivate Ethernet link again and again.
Just curious - why?
__________________
Kill your t.v.
Reply With Quote
  #9   (View Single Post)  
Old 4th September 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,051
Thanked 198 Times in 156 Posts
Default

Quote:
Originally Posted by rex View Post
I did, but didn't scroll down that far... my bad.
Thanks to all for the tips. I'll note it down for future refrence.
Using the / key to search is usually much faster and quite efficient, for example, try searching ifconfig(8) for disable and see how many seconds it takes to find the answer to the question
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 4th September 2008
rex rex is offline
Real Name: Nikhil Rathod
Shell Scout
 
Join Date: May 2008
Location: Chicago
Posts: 114
Thanked 2 Times in 2 Posts
Talking

Quote:
Originally Posted by anomie View Post
Just curious - why?
Something related to my work. Needed to test how efficient the algorithm is in determining the length of the Ethernet cable for one of our products.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Broadcom BCM5906M 10/100 Ethernet Driver? revzalot Solaris 0 15th June 2009 05:47 PM
Ethernet UP clobbers PPP IdOp NetBSD General 1 9th March 2009 05:03 PM
My D-Link DFE530TX ethernet adapter isnt found. Help! Quaxo OpenBSD Installation and Upgrading 15 10th February 2009 12:23 AM
broadcom ethernet jaideep_jdof NetBSD General 0 16th November 2008 05:33 PM
Installing software without Ethernet Card welkin FreeBSD Ports and Packages 2 27th July 2008 12:12 AM


All times are GMT. The time now is 04:25 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick