LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-26-2011, 06:33 PM   #1
venom4u31
Member
 
Registered: Oct 2011
Distribution: Debian 6
Posts: 47

Rep: Reputation: Disabled
ifup and ifdown commands don't work.


I'm running Debian 6. I have an interface named eth1 on it. I want to run ifup and ifdown on it because those are the only commands that access the interfaces file in /etc/network.

However, if the eth1 network is up:

when I run ifdown eth1 (eth1 is up) it displays:
Code:
ifdown: interface eth1 not configured
and none of the commands in the interfaces file are ran (not even those following down).

when I run ifdown --force eth1, it runs the down commands in the interfaces file, but it also displays the following message:
Code:
SIOCDELRT: No such process
and the network does not go down.

If the eth1 network is down:
when I run ifup eth1, the computer displays:
Code:
SIOCADDRT: No such process
Failed to bring up eth1.
. Also, none of the commands inside the interfaces file are ran.

when I run ifup --force eth1 it does the same thing.

Also I noticed that an interface called 5.0 appears when I run ifconfig after I run any of the ifup commands.

Can you tell me how to successfully run the ifup and the ifdown commands so that the instructions in the interfaces file may be ran accordingly?
 
Old 11-26-2011, 06:55 PM   #2
aus9
LQ Addict
 
Registered: Oct 2003
Location: Australia
Distribution: MX 16
Posts: 5,298

Rep: Reputation: Disabled
hi

I have only one network device but suspect you have 2

lspci -v should show them.

2) do you have a file called /etc/network/interfaces?

this should show you how to up them?
 
Old 11-26-2011, 06:57 PM   #3
venom4u31
Member
 
Registered: Oct 2011
Distribution: Debian 6
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by aus9 View Post
hi

I have only one network device but suspect you have 2

lspci -v should show them.

2) do you have a file called /etc/network/interfaces?

this should show you how to up them?
Yes, I have 2 networks. I also have eth0.

The /etc/network/interfaces file looks like this:
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp



#eth1

auto eth1
iface eth1 inet static
 address 10.5.10.200
 netmask 255.255.255.128
 gateway 255.255.255.129
 up date +"UP [%m-%d-%y/%H:%M:%S]" >> /var/log/file.log
 down date +"DOWN [%m-%d-%y/%H:%M:%S]" >> /var/log/file.log
 pre-up ifconfig eth1 hw ether aa:bb:cc:dd:05:0a
 down echo "hello world"
 
Old 11-26-2011, 06:59 PM   #4
andywebsdale
Member
 
Registered: Jan 2005
Location: Lewisham,London,UK
Distribution: Debian Wheezy AMD64
Posts: 87
Blog Entries: 2

Rep: Reputation: 23
I presume you're using the CLI, & not using any GUI stuff like Network Manager (or any other Gnome/KDE stuff)
Have you read the relevant bit of the Debian manual - here's a link to Debian Reference Manual - The Basic Network Configuration with ifupdown
First thing is to sanity check all the relevant config files. Hopefully the Reference will highlight what's wrong with your networking configuration
Your gateway looks weird to me - is that your gateway's address or am I not understanding something?
EDIT: Also that error message is shown if there are invalid addresses in the config file

Last edited by andywebsdale; 11-26-2011 at 07:09 PM. Reason: Addition
 
Old 11-26-2011, 07:16 PM   #5
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
Not sure if this would solve the issue at hand, however, once I had a similar problem and had to use the ifconfig eth1 up command. This tended to work OK.
 
Old 11-26-2011, 07:19 PM   #6
venom4u31
Member
 
Registered: Oct 2011
Distribution: Debian 6
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andywebsdale View Post
I presume you're using the CLI, & not using any GUI stuff like Network Manager (or any other Gnome/KDE stuff)
Have you read the relevant bit of the Debian manual - here's a link to Debian Reference Manual - The Basic Network Configuration with ifupdown
First thing is to sanity check all the relevant config files. Hopefully the Reference will highlight what's wrong with your networking configuration
Your gateway looks weird to me - is that your gateway's address or am I not understanding something?
EDIT: Also that error message is shown if there are invalid addresses in the config file
I've read the reference, but I don't think it helps me. Ifdown and ifup work just fine on eth0, but on eth1 they don't work at all...
 
Old 11-26-2011, 07:27 PM   #7
andywebsdale
Member
 
Registered: Jan 2005
Location: Lewisham,London,UK
Distribution: Debian Wheezy AMD64
Posts: 87
Blog Entries: 2

Rep: Reputation: 23
Have another look at your gateway address - it isn't valid, that's why you're getting error messages & its bombing out
It should be an address that exists either on the public internet or as a private address using the reserved address spaces.

Last edited by andywebsdale; 11-26-2011 at 08:00 PM.
 
Old 11-26-2011, 07:48 PM   #8
Brains
Member
 
Registered: Apr 2009
Distribution: Debian testing
Posts: 375

Rep: Reputation: 77
I recently tried to connect to a wireless ap from command line using ifconfig and iwconfig and the last command to get connected, dhclient eth1. It never worked this way, from command line Debian wiki says you need to configure the interfaces file. But just configuring it does not get me connected, running the dhclient command has the interfaces file processed and a connection is established via dhcp. I would think the router needs to be configured to use dhcp.
 
Old 11-27-2011, 03:43 AM   #9
venom4u31
Member
 
Registered: Oct 2011
Distribution: Debian 6
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andywebsdale View Post
Have another look at your gateway address - it isn't valid, that's why you're getting error messages & its bombing out
It should be an address that exists either on the public internet or as a private address using the reserved address spaces.
I used a subnet calculator and determined that my default gateway should be like this: 10.5.10.129 (first usable address).

Now my interfaces file looks like this, but it does not have any effect:
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp



#eth1

auto eth1
iface eth1 inet static
 address 10.5.10.200
 netmask 255.255.255.128
 gateway 10.5.10.129
 up date +"UP [%m-%d-%y/%H:%M:%S]" >> /var/log/file.log
 down date +"DOWN [%m-%d-%y/%H:%M:%S]" >> /var/log/file.log
 pre-up ifconfig eth1 hw ether aa:bb:cc:dd:05:0a
 down echo "hello world"
ifup and ifdown still do not work.
 
Old 11-27-2011, 12:41 PM   #10
andywebsdale
Member
 
Registered: Jan 2005
Location: Lewisham,London,UK
Distribution: Debian Wheezy AMD64
Posts: 87
Blog Entries: 2

Rep: Reputation: 23
Have you tried using the /sbin/ifconfig command to configure eth1 - it might give you a more explanatory error message. Also, when you boot, as eth1 is set to auto, the errors should be logged in /var/log depending on your logging setup, & they might be able to tell you something.
The gateway address is normally the address of your router or another machine that is the "gateway" to the network, i.e another network or the internet i.e the route that you want traffic to take when as address isn't on the local network(e.g. an internet address).
What exactly are you aiming at with this network config? If eth1 is connected to the 10.5.10.128/25 network & the plan is that traffic from the 10.5.10.128/25 is connected to the internet through this machine, perhaps with filtering, then eth1 doesn't need a gateway address at all & the other PCs on the 10.5.10.128/25 network will use 10.5.10.200 as their gateway.
A network that notwork can be very frustrating, I know...
 
Old 11-27-2011, 12:44 PM   #11
venom4u31
Member
 
Registered: Oct 2011
Distribution: Debian 6
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andywebsdale View Post
Have you tried using the /sbin/ifconfig command to configure eth1 - it might give you a more explanatory error message. Also, when you boot, as eth1 is set to auto, the errors should be logged in /var/log depending on your logging setup, & they might be able to tell you something.
The gateway address is normally the address of your router or another machine that is the "gateway" to the network, i.e another network or the internet i.e the route that you want traffic to take when as address isn't on the local network(e.g. an internet address).
What exactly are you aiming at with this network config? If eth1 is connected to the 10.5.10.128/25 network & the plan is that traffic from the 10.5.10.128/25 is connected to the internet through this machine, perhaps with filtering, then eth1 doesn't need a gateway address at all & the other PCs on the 10.5.10.128/25 network will use 10.5.10.200 as their gateway.
A network that notwork can be very frustrating, I know...
You have a point there...


I solved the problem: eth1 should not be configured the auto. Deleting or commenting "auto eth1" solved the whole thing.

Yes, it's very frustrating, I use ip or ifconfig... However they don't execute the required scrips, so I'm stuck with ifup and ifdown that succede the other commands (which means that if a network or interface is downed or upped by ifconfig, for example, ifup or ifdown won't have any effect on it).

Last edited by venom4u31; 11-27-2011 at 12:52 PM.
 
Old 11-27-2011, 12:50 PM   #12
andywebsdale
Member
 
Registered: Jan 2005
Location: Lewisham,London,UK
Distribution: Debian Wheezy AMD64
Posts: 87
Blog Entries: 2

Rep: Reputation: 23
Pleased to hear that you've solved it - I take your point about scripting.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ifup/ifdown script? MrUmunhum Linux - Networking 1 02-14-2010 08:09 PM
ifconfig , ifdown, ifup deci007 Linux - Newbie 2 11-13-2009 02:00 AM
slack 9.1 and ifdown/ifup? redbull Linux - Networking 3 04-04-2004 10:11 AM
ifup/ifdown? redbull Linux - Software 2 04-04-2004 05:30 AM
dhclient and ifup/ifdown Atroxic Linux - Networking 0 10-19-2003 01:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration