Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Absolute Beginner Talk
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.

Absolute Beginner Talk
The perfect starting place to find out more about computers, Linux and Ubuntu.

 
Thread Tools Display Modes
Old September 20th, 2007   #1
hannaman
First Cup of Ubuntu
 
hannaman's Avatar
 
Join Date: Jan 2007
Beans: 11
Ubuntu 9.04 Jaunty Jackalope
[SOLVED] Create virtual interface

I am trying to set up a virtual interface off of my primary eth0.
I would like to have eth0 use dhcp and eth0:1 use a static IP address. I want to keep the dhcp so that network manager manages that port so I don't have to learn how connect to my company VPNs another way, but I want a static virtual interface so that I can use for my web server and not have to be concerned about changing port forwarding if the dhcp changes, etc.

Here is I what I have for /etc/network/interfaces:
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth0:1
iface eth0:1 inet static
address 192.168.2.200
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1
hardware address 00:11:11:C2:C8:03
I am not sure about the hardware address line. I read on another forum that the MAC addresses should be different so I made slight changes to the actual MAC address.
Here is what happens when I restart networking:
Code:
 * Reconfiguring network interfaces...                                         
There is already a pid file /var/run/dhclient.eth0.pid with pid 14797
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth0/00:11:11:c1:c7:02
Sending on   LPF/eth0/00:11:11:c1:c7:02
Sending on   Socket/fallback
DHCPRELEASE on eth0 to 192.168.2.1 port 67
SIOCDELRT: No such device
There is already a pid file /var/run/dhclient.eth0.pid with pid 134993416
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth0/00:11:11:c1:c7:02
Sending on   LPF/eth0/00:11:11:c1:c7:02
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPOFFER from 192.168.2.1
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.2.1
SIOCADDRT: File exists
bound to 192.168.2.2 -- renewal in 488780 seconds.
SIOCSIFFLAGS: Cannot assign requested address                                   [ OK ]
I see that it cannot assign requested address, but I am unsure why. If I static just eth0, that address gets assigned no problem, but Network Manager no longer manages the interface obviously.

Thanks

Last edited by hannaman; September 21st, 2007 at 08:15 PM..
hannaman is offline   Reply With Quote
Old September 21st, 2007   #2
hannaman
First Cup of Ubuntu
 
hannaman's Avatar
 
Join Date: Jan 2007
Beans: 11
Ubuntu 9.04 Jaunty Jackalope
[SOLVED] Create virtual interface

For those that are concerned (since no one replied, I assume no one is) I finally resolved this issue. Here is what my /etc/network/interfaces file looks like now:

Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
hwaddress ether 00:11:11:C1:C7:02

auto eth0:1
iface eth0:1 inet static
address 192.168.2.200
netmask 255.255.255.0
gateway 192.168.2.1
hwaddress ether 00:11:11:C1:C7:02
I can now access my website through the static virtual IP and still have network manager manage eth0 and my VPN connections.
hannaman is offline   Reply With Quote
Old December 27th, 2007   #3
Yfrwlf
Way Too Much Ubuntu
 
Yfrwlf's Avatar
 
Join Date: Dec 2006
Beans: 286
Ubuntu 9.04 Jaunty Jackalope
Re: [SOLVED] Create virtual interface

Quote:
Originally Posted by hannaman View Post
For those that are concerned (since no one replied, I assume no one is) I finally resolved this issue. Here is what my /etc/network/interfaces file looks like now:

Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
hwaddress ether 00:11:11:C1:C7:02

auto eth0:1
iface eth0:1 inet static
address 192.168.2.200
netmask 255.255.255.0
gateway 192.168.2.1
hwaddress ether 00:11:11:C1:C7:02
I can now access my website through the static virtual IP and still have network manager manage eth0 and my VPN connections.
I know this is old and you probably don't care, but thanks for posting all this, I was wondering about setting up virtual interfaces for multiple websites off one apache server so this helped me, thank you!!
Yfrwlf is offline   Reply With Quote
Old March 21st, 2008   #4
eode
5 Cups of Ubuntu
 
Join Date: Apr 2006
Location: New Orleans, LA
Beans: 21
Ubuntu 9.04 Jaunty Jackalope
Send a message via AIM to eode Send a message via Yahoo to eode
Re: Create virtual interface

I found this useful, too. Thank you.
eode is offline   Reply With Quote
Old June 12th, 2008   #5
shimmyt
First Cup of Ubuntu
 
Join Date: Aug 2006
Beans: 7
Re: Create virtual interface

Still helpful
shimmyt is offline   Reply With Quote
Old July 5th, 2008   #6
valeriupalos
First Cup of Ubuntu
 
Join Date: May 2008
Location: Bucharest, Romania
Beans: 2
Ubuntu 8.04 Hardy Heron
Re: Create virtual interface

Yup, still helped!
valeriupalos is offline   Reply With Quote

Bookmarks

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

Forum Jump


All times are GMT -4. The time now is 10:21 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry