Operating System - Linux
1819809 Members
2927 Online
109607 Solutions
New Discussion юеВ

RHAS3U3 - ifconfig eth0 down/up

 
SOLVED
Go to solution
Matthias Bayer
Advisor

RHAS3U3 - ifconfig eth0 down/up

Hi,

i have the following problem with ifconfig comand:

everytime i run the command 'ifconfig eth0 down' the network goes down - fine. now i run 'ifconfig eth0 up' - the network starts up BUT from now on i don't have a functioning name resolution anymore. i can ping other systems via their ip addresses but i cannot ping them by their names anymore.
also the routing table does not have a default gateway set anymore.

doing the same with 'service network stop/start' doesn't show this behaviour....
any ideas why and how to fix this ?

thanks,
Matthias
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: RHAS3U3 - ifconfig eth0 down/up

ifconfig eth0 ip_address netmask up

example


ifconfig eth0 192.168.0.50 mask 255.255.255.0 up


Your subnet mask needs to be compatible with the subnet masks of the servers in /etc/resolv.conf for DNS names resolution to work right.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Matthias Bayer
Advisor

Re: RHAS3U3 - ifconfig eth0 down/up

Thanks Steven,

but didn't work for me here ????
my DNS server is located in another subnet and the default gateway is still not showing up even if i specify the netmask...and i can't specify a gateway if i see it right ...

so same behaviour as befire ...any other ideas ...

Matthias
Stuart Browne
Honored Contributor
Solution

Re: RHAS3U3 - ifconfig eth0 down/up

You mind me asking why you're bringing the ethernet interface down? It's fairly unusual from my line of thinking.

When you remove the interface, all the associated routing also gets removed (so any subnet routes, and if the default route is out that interface, that too!).

After you've brought the interface back up, you then need to re-add any static or default routes that previously relied upon that interface.

Short cut would be to use the 'ifdown eth0' and 'ifup eth0' routines, which take all of this into consideration. These are the commands that the 'network' service call to stop/start an interface.
One long-haired git at your service...
Matthias Bayer
Advisor

Re: RHAS3U3 - ifconfig eth0 down/up

Hi Stuart,

the reason was just a test situation where i wantet to stop networking of one system while another was using the test network for performance measuring ....

you are right, ifdown and ifup does the job perfectly instead of ifconfig eth0 down/up.

problem solved - thanks for any help to everybody !!

bye
Matthias