LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-14-2008, 04:36 PM   #1
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Create a sub interface with dhcp


Hello,

(Using Ubuntu 8.04)

I know I can add a subinterface in /etc/network/interfaces and it will be all fine and dandy...

But I don't want it permenant...

In Solaris I would just need to do this...
Code:
root@home# touch /etc/hostname.eth0:1 && touch /etc/dhcp.eth0:1
root@home# ifconfig eth0:1 plumb
root@home# ifconfig eth0:1 dhcp start
Apperently this simplicity doesn't exist in Linux (or at least I can't find how to do this in Linux...that's why I'm posting...)

Is there anyway to do the above in Linux? Again...I don't want it permanent....I just want to be able to do it "on the fly" while I'm on the command line...

I've tried searching Google...but it seems that every solution I find permanently adds the interface...which I don't want.

Any help/suggestions/guidance would be greatly apreceated...

Thanks,

-C
 
Old 09-14-2008, 04:40 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
IP aliasing:
http://www.faqs.org/docs/Linux-mini/IP-Alias.html
http://pachome1.pacific.net.sg/~hari...uxipalias.html

Last edited by Mr. C.; 09-14-2008 at 04:42 PM.
 
Old 09-14-2008, 04:45 PM   #3
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
From the command line :

Code:
ifconfig eth0:1 192.168.1.100 up
to create an aliases interface with the IP 192.168.1.100

Code:
ifconfig eth0:1 down
to remove the interface.
 
Old 09-14-2008, 05:57 PM   #4
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979

Original Poster
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by bgeddy View Post
From the command line :

Code:
ifconfig eth0:1 192.168.1.100 up
to create an aliases interface with the IP 192.168.1.100

Code:
ifconfig eth0:1 down
to remove the interface.
Yes...that assigns a static ip address...I was wondering if it is possible to have dhcp assign the ip for me?

-C
 
Old 09-14-2008, 06:03 PM   #5
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
http://209.85.173.104/search?q=cache...lnk&cd=3&gl=us
 
Old 09-14-2008, 06:46 PM   #6
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979

Original Poster
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by Mr. C. View Post
Thanks!

Looks like I'm getting closer now....

But I'm getting an error...trying to run dhcpcd...

Code:
root@CH2:/usr/local/bin# dhcpcd  -h CH2-2 eth0:1
Error, eth0:1: ioctl SIOCSIFFLAGS: Cannot assign requested address
I tried it with the switches from the site you linked to...but still no luck :/

Help? Thanks

-C
 
Old 09-17-2008, 12:09 AM   #7
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Sorry, I don't know the answer. Perhaps my response here, bumping the thread will freshen its view to other more knowledgeable eyes.
 
Old 04-26-2010, 04:15 PM   #8
dumdadum
Member
 
Registered: May 2009
Location: Montreal, Quebec, Canada
Distribution: Slackware 14.1 64 bits
Posts: 238

Rep: Reputation: 15
Exclamation I get the same error

Quote:
Originally Posted by custangro View Post
Thanks!

Looks like I'm getting closer now....

But I'm getting an error...trying to run dhcpcd...

Code:
root@CH2:/usr/local/bin# dhcpcd  -h CH2-2 eth0:1
Error, eth0:1: ioctl SIOCSIFFLAGS: Cannot assign requested address
I tried it with the switches from the site you linked to...but still no luck :/

Help? Thanks

-C
I get the same error.

The way I set up this slackware machine was with PXE. And it had to fetch the ip adress from my other slackware machine which I had set up with a dhcp server on.

Now is it possible that the rc.inet1 is trying to fetch the adress from a dhcp server that doesnt exist? If so, how can I solve this? I want the ip adress to be assigned by my adsl modem/routeur.

Let me know,
Dumdadum
 
Old 04-26-2010, 04:35 PM   #9
dumdadum
Member
 
Registered: May 2009
Location: Montreal, Quebec, Canada
Distribution: Slackware 14.1 64 bits
Posts: 238

Rep: Reputation: 15
Question Slackware 13.0...

Btw, I get this error with Slackware 13.0 using the following command or simply at bootup time:

/etc/rc.d/rc.inet1 restart

Any help?
Dumdadum
 
Old 04-26-2010, 05:06 PM   #10
dumdadum
Member
 
Registered: May 2009
Location: Montreal, Quebec, Canada
Distribution: Slackware 14.1 64 bits
Posts: 238

Rep: Reputation: 15
Question eth0

When I do this command:

ifconfig eth0

I get a hardware adress of 00:00:00:00:00:00

Is this normal? Why was it working before? Is the nic card messed up?

Dumdadum
 
  


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
Configuring Atheros interface for DHCP C's Brother Solaris / OpenSolaris 5 08-05-2008 06:50 AM
A DHCP request for an usuable interface. pxumsgdxpcvjm Slackware 2 08-26-2007 04:20 PM
How to create a virtual interface? Whyte Linux - Networking 2 03-27-2007 01:07 PM
How do I create a eth0 interface? DodoTux Linux - Networking 5 08-28-2006 01:25 PM
interface ok, dhcp ok, routing gw not ok- help sokar Linux - Wireless Networking 4 02-04-2004 10:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:06 PM.

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
Open Source Consulting | Domain Registration