Networking Forums

Networking Forums > Computer Networking > Linux Networking > ifconfig eth0 down works but it won't go up!

Reply
Thread Tools Display Modes

ifconfig eth0 down works but it won't go up!

 
 
Al. C
Guest
Posts: n/a

 
      11-13-2004, 07:15 PM
I'm running Slack 9.1 on an ancient IBM 600e laptop, DSL via Linksys router,
DHCP/PPPoE .... usual configuration.

If I do ifconfig eth0 down and then an ifconfig eth0 up, I can't do a simple
ping -c google.com. I get:
ping: unknown host google.com

What is going on? Once I do a "down" I'm dead. Even doing
rc.inetd restart
does not help.

The only thing that brings back the connectivity is to reboot.

Al

 
Reply With Quote
 
 
 
 
Bit Twister
Guest
Posts: n/a

 
      11-13-2004, 07:50 PM
On Sat, 13 Nov 2004 20:15:33 GMT, Al. C wrote:
> I'm running Slack 9.1 on an ancient IBM 600e laptop, DSL via Linksys router,
> DHCP/PPPoE .... usual configuration.
>
> If I do ifconfig eth0 down and then an ifconfig eth0 up, I can't do a simple
> ping -c google.com. I get:
> ping: unknown host google.com


does ping -c 1 216.239.57.99 work?
If so show us /etc/resolv.conf
If not gateway is not set, show us route -n

 
Reply With Quote
 
Al. C
Guest
Posts: n/a

 
      11-13-2004, 08:01 PM
Bit Twister wrote:

> On Sat, 13 Nov 2004 20:15:33 GMT, Al. C wrote:
>> I'm running Slack 9.1 on an ancient IBM 600e laptop, DSL via Linksys
>> router, DHCP/PPPoE .... usual configuration.
>>
>> If I do ifconfig eth0 down and then an ifconfig eth0 up, I can't do a
>> simple ping -c google.com. I get:
>> ping: unknown host google.com

>
> does ping -c 1 216.239.57.99 work?


No it does not. "connect: Network is unreachable

> If so show us /etc/resolv.conf


nameserver 206.13.21.12
nameserver 106.13.28.12

> If not gateway is not set, show us route -n


Dest Gate Genmask Flag Iface
192.168.1.0 0.0.0.0 255.255.255.0 U eth0
127.0.0.0 0.0.0.0 255.0.0.0 U lo

Ref and Metric were both zero for both

On my desktop machine (running same Slack and connected to same router) I see
a default gatewasy of 192.168.1.1. What happend to my gateway and can I get
it back without rebooting?

I've tried runnin inetd and intet1 and inet2 and nothing seems to restore the
network.... except a reboot.

Any help is appreciated.

Thanks,
Al


 
Reply With Quote
 
Timothy Murphy
Guest
Posts: n/a

 
      11-13-2004, 10:35 PM
Al. C wrote:

>>> If I do ifconfig eth0 down and then an ifconfig eth0 up, I can't do a
>>> simple ping -c google.com. I get:
>>> ping: unknown host google.com


So why do you say "ifconfig eth0 down" ??

> I've tried runnin inetd and intet1 and inet2 and nothing seems to restore
> the network.... except a reboot.


You don't say what system you're running.
On Redhat/Fedora you probably need to say "service network restart".
On other systems it might be "/etc/rc.d/init.d/network restart"
or something like that.

--
Timothy Murphy
e-mail (<80k only): tim /at/ birdsnest.maths.tcd.ie
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland
 
Reply With Quote
 
Al. C
Guest
Posts: n/a

 
      11-13-2004, 10:45 PM
Timothy Murphy wrote:

> Al. C wrote:
>
>>>> If I do ifconfig eth0 down and then an ifconfig eth0 up, I can't do a
>>>> simple ping -c google.com. I get:
>>>> ping: unknown host google.com

>
> So why do you say "ifconfig eth0 down" ??
>
>> I've tried runnin inetd and intet1 and inet2 and nothing seems to restore
>> the network.... except a reboot.

>
> You don't say what system you're running.
> On Redhat/Fedora you probably need to say "service network restart".
> On other systems it might be "/etc/rc.d/init.d/network restart"
> or something like that.
>


First of all, I'm sure in the opening post I said I run Slackware 9.1 with
KDE.

OK, here is the answer (or at least AN answer.... the gurus here might have a
better one.)

It seems (for me anyway) that "ifconfig eth0 down" deletes the default gateway
from route table. (And it makes sense if the gateway is the ethernet card...
so if it goes down, Linux is correct in erasing an entry from the route table
(if there is such an animal.)

Did some more reading and from

http://tinyurl.com/3kgm9

I found that doing the command:

route add default gw 129.168.1.1

brings back network functionality after an "ifconfig eth0 up" command. The
web page cited above uses a different command and the man route page is
cryptic as hell, but after trying to put the man page together with the above
web page, I think I figured it out.

Which comes down to this. For me, if I want to use the modem AND I'm connected
to the router at boot time, I need to do the "ifconfig eth0 down" command and
then dial out. After hanging up, I can bring DSL connectivity back by doing
the "up" command and then the route command above. If I boot laptop without
the cable connected to the router, I don't have to do the eth0 down thing.
Not sure why.

I really thought there was a way to be online with DSL and the modem at the
same time, but I guess not. (Why would you want to do this? Some people still
have dial-up to their bank to send credit card sales txns.)

Thanks for the help. I hope some of this is useful to someone else sometime.
It's been a learning experience for me.

Al
 
Reply With Quote
 
Bruce Stewart
Guest
Posts: n/a

 
      11-14-2004, 01:02 PM
Al. C wrote:

> Timothy Murphy wrote:
>
>> Al. C wrote:
>>
>>>>> If I do ifconfig eth0 down and then an ifconfig eth0 up, I can't do
>>>>> a simple ping -c google.com. I get:
>>>>> ping: unknown host google.com

>>
>> So why do you say "ifconfig eth0 down" ??
>>
>>> I've tried runnin inetd and intet1 and inet2 and nothing seems to
>>> restore the network.... except a reboot.

>>
>> You don't say what system you're running.
>> On Redhat/Fedora you probably need to say "service network restart".
>> On other systems it might be "/etc/rc.d/init.d/network restart"
>> or something like that.
>>

>
> First of all, I'm sure in the opening post I said I run Slackware 9.1
> with KDE.
>
> OK, here is the answer (or at least AN answer.... the gurus here might
> have a better one.)
>
> It seems (for me anyway) that "ifconfig eth0 down" deletes the default
> gateway from route table. (And it makes sense if the gateway is the
> ethernet card... so if it goes down, Linux is correct in erasing an
> entry from the route table (if there is such an animal.)
>
> Did some more reading and from
>
> http://tinyurl.com/3kgm9
>
> I found that doing the command:
>
> route add default gw 129.168.1.1
>
> brings back network functionality after an "ifconfig eth0 up" command.
> The web page cited above uses a different command and the man route page
> is cryptic as hell, but after trying to put the man page together with
> the above web page, I think I figured it out.
>
> Which comes down to this. For me, if I want to use the modem AND I'm
> connected to the router at boot time, I need to do the "ifconfig eth0
> down" command and then dial out. After hanging up, I can bring DSL
> connectivity back by doing the "up" command and then the route command
> above. If I boot laptop without the cable connected to the router, I
> don't have to do the eth0 down thing. Not sure why.
>
> I really thought there was a way to be online with DSL and the modem at
> the same time, but I guess not. (Why would you want to do this? Some
> people still have dial-up to their bank to send credit card sales txns.)
>
> Thanks for the help. I hope some of this is useful to someone else
> sometime. It's been a learning experience for me.
>
> Al


Al,
You shouldn't need to drop eth0 before or after raising a ppp connection.
KInternet should handle the setup of the ppp connection, this will change
the gateway to the ppp connection, but should allow access to your local
network, in addition it can change the nameservers to the ones for your
ppp connection.
If you are directly connecting to the internet with your DSL, not through
a local network and you are using your ppp connection, you will more than
likely need a slightly more complex routing table to be able to route to
the bank IP ranges as well as the internet through the DSL connection.

Regards
Bruce.

--
Replace by by blueyonder
 
Reply With Quote
 
Sundial Services
Guest
Posts: n/a

 
      11-14-2004, 02:00 PM

>>>>>> If I do ifconfig eth0 down and then an ifconfig eth0 up, I can't do
>>>>>> a simple ping -c google.com. I get:
>>>>>> ping: unknown host google.com

> You shouldn't need to drop eth0 before or after raising a ppp connection.
> KInternet should handle the setup of the ppp connection, this will change
> the gateway to the ppp connection, but should allow access to your local
> network, in addition it can change the nameservers to the ones for your
> ppp connection.
> If you are directly connecting to the internet with your DSL, not through
> a local network and you are using your ppp connection, you will more than
> likely need a slightly more complex routing table to be able to route to
> the bank IP ranges as well as the internet through the DSL connection.


Also, don't forget that if you are trying to test the ability to "ping," you
need to enter some numeric IP-address; not a host-name such as
"google.com." A host-name must be resolved, via a DNS lookup, and tests of
this are better handled using the command "dig." If you are testing for
communications, look up the IP-address ahead of time.
 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      11-14-2004, 04:59 PM
In article <L0xld.21138$(E-Mail Removed) >, Al. C wrote:

>It seems (for me anyway) that "ifconfig eth0 down" deletes the default gateway
>from route table. (And it makes sense if the gateway is the ethernet card...
>so if it goes down, Linux is correct in erasing an entry from the route table
>(if there is such an animal.)


Correct - you have no means of reaching the gateway, so the entry should
be deleted.

>http://tinyurl.com/3kgm9


Sorry - don't use those, but I can sorta guess what it might be telling

>route add default gw 129.168.1.1
>
>brings back network functionality after an "ifconfig eth0 up" command. The
>web page cited above uses a different command and the man route page is
>cryptic as hell, but after trying to put the man page together with the above
>web page, I think I figured it out.


[compton ~]$ whatis ifconfig route
ifconfig (8) - configure a network interface
route (8) - show / manipulate the IP routing table
[compton ~]$

The purpose of the 'ifconfig' command is to bring the interface up and
down, setting parameters DIRECTLY related to the interface (IP address,
network address, broadcast, MTU, hardware address, etc.). Starting with
either the 2.0.0 or 2.2.0 kernel (can't remember which), _Linux_ added
the function that bringing up an interface also added a network route
for the configured interface/network. This _HAD_ been done as a separate
command before.

The purpose of the 'route' command is to add/subtract routes that use
the existing networking setup. Traditionally, you ran the ifconfig to
bring up the interface, then ran the route command to add routes - first
being a network address, and then OPTIONALLY, you would add routes to
other networks, using hosts on the local network as gateway routers. The
first route command has now been combined with the 'ifconfig up' function,
but the optional second command can't be combined, because no one knows
what routes you might have, or the IP address of those gateways. So,
you have to add those extra routes as a separate step.

>Which comes down to this. For me, if I want to use the modem AND I'm
>connected to the router at boot time, I need to do the "ifconfig eth0
>down" command and then dial out.


OK, I'll ignore the security aspects of this one. Your problem is with
the pppd daemon. Starting with ppp-2.3.6, the behavior changed such that
if you have a PRE-EXISTING default route on your computer, pppd will
assume that you are an ISP, _AND_ that who ever you are connecting to
will have to authenticate to you. The way around that is the 'noauth'
option to pppd. There is a SECOND PROBLEM with this if you are trying
to use the 'defaultroute' option to pppd when you already have a pre-
existing default route. pppd will not _replace_ a default route (although
some of the "helper programs" can force this - but who cares about
security). Look at the programming definition of a 'default' - it's what
you use when nothing else fits. That matches the meaning of the default
route - it's the route you use when nothing else is defined. So, if you
have two defaults, which do you use? Flip a coin?

>I really thought there was a way to be online with DSL and the modem at the
>same time, but I guess not. (Why would you want to do this? Some people still
>have dial-up to their bank to send credit card sales txns.)


Likely, you need the 'noauth' option to pppd, but the routing thing may also
be a problem. When you dial in, are there computers BEYOND the one at the
other end of the telephone line that you are accessing using the peer as
a gateway? If 'no' then don't include the 'defaultroute' option to pppd.
If yes, the "correct" solution is to add a specific network route in the
/etc/ppp/ip-up (or ip-up.local if your distribution wants you to use that)
such as

/sbin/route add -net 123.45.67.0 netmask 255.255.255.0 -gw $5 $1

and delete the route in /etc/ppp/ip-down (or ip-down.local). The ip-up
is run when the ppp interface goes up for IP, with $1 being the
interface name, and $5 being the IP of the peer. See the pppd man page,
looking under section "SCRIPTS" for more details. Oh, and to find
out if you need the network route or not, just run tcpdump on the
existing dialin connection, and see who your system is talking to.

There is another alternative, and that's to use the noauth option, and
in ip-up first run a route command to delete the _existing_ default,
and add a new default manually.

/sbin/route del default
/sbin/route add default -gw $5 $1

and in ip-down, reverse this action. You'd need to know the gateway
address on the Ethernet link, as Linux has no way of guessing what it might
be. Not knowing what your local network setup might be, and what is in
your network scripts, I don't know why your _LATER_ use of 'intet1 restart'
doesn't work. It _might_ be a firewall issue.

Old guy
 
Reply With Quote
 
Robert Marshall
Guest
Posts: n/a

 
      11-20-2004, 05:59 PM
On Sat, 13 Nov 2004, (E-Mail Removed) wrote:

> I found that doing the command:
>
> route add default gw 129.168.1.1
>
> brings back network functionality after an "ifconfig eth0 up"
> command. The web page cited above uses a different command and the
> man route page is cryptic as hell, but after trying to put the man
> page together with the above web page, I think I figured it out.
>


Have you said why you wanting to do this? If you want to dial into
another isp because - for instance they only allow you access to your
webspace with them if you are dialled in, then you don't necessarily
need to take eth0 down

I just change the routing

route add -net xxx.xxx.xxx.0 netmask 255.255.255.0 ppp0

where xxx.xxx.xxx matches whatever end it is of ip number of the isp

put that in ip-up.local and remove it in ip-down.local

Robert
--
La grenouille songe..dans son château d'eau
 
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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"ifconfig eth0" command not showing the Gateway address, how can I verify on Linux system? santa19992000@yahoo.com Linux Networking 3 10-16-2005 04:48 PM
eth0 works with Linksys hub but not Netgear switch?!? pt Linux Networking 3 07-11-2005 02:54 PM
eth0 works, but needs to ping the gateway to jumpstart it Aaron E. Klemm Linux Networking 5 01-23-2005 03:07 AM
nat works with ppp but not eth0 roger Linux Networking 4 02-04-2004 04:01 AM
Correct Way to Configure eth0 using ifconfig for range of ips: Value for Broadcast?? Dr. E Linux Networking 7 12-28-2003 10:25 PM



1 2 3 4 5 6 7 8 9 10 11