Restart Ethernet Interface

samjud
samjud used Ask the Experts™
on
I have a Linux box, I used WinSCP to change the configuration (there was no default-gateway and I added one) on one of the Ethernet ports (eth0). Is there a command I can run to restart the interface to have the changes take effect without restarting the machine?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
I usually just use (as root):

rcnetwork restart

I think you can also do something like:

ifconfig eth0 down; ifconfig eth0 up

(see "man ifconfig")

Author

Commented:
That actually worked perfect.
I just have a question, If there was no default gateway on one of the ethernet ports and I added one, and then ran the above commands, Will it have taken effect? I assume yes.

Commented:
I'm actually not sure. I seem to remember running this command to take an ip address change into effect and from what I remember it may not have taken the change.

What distribution are you using? Is there a way to go into the network card settings after making the change and then running that command and checking what the gateway is (to see if it really changed or not)?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
I'm  not sure to either questions, any suggestions would be very helpful.

Author

Commented:
the ifconfig command by itself gives status of the network interfaces and I don't see any default gateways configured at all

Commented:
Do you know what version of Linux you are running?

Author

Commented:
Sorry to sound dumb, but how can I tell?

Commented:
The first way is just to notice any splash screens that show up when you are booting into your system. Most distributions will have some kind of screen or logo that lets you know what distro it is.

Another thing to try is to run "cat /proc/version". Somewhere in the string that is returned, you should find what type of Linux you are running.

Depending on what distribution you are running, there should be some graphical configuration utility (on SuSE it is called YaST). Look in your "startup" menu to see if you can find anywhere to configure a network card.

You also mentioned WinSCP to configure your network card. Will that program let you know what the current settings are as well?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial