Spread Linux

Categories


Recent Comments:



FeedWind
FeedWind
Get Linux

Baudizm at Blogged

December 7, 2007

Adding virtual IP addresses on OpenSuSE, SLED10, SLES10

Filed under: Linux, Tips and Tricks - baudizm @ 10:37 am

The following article contains opinions and personal views of the author and will be taken as such. There is no guarantee to the accuracy, timeliness of some of the information that may be found within the article. The methods that are discussed here might not be applicable in your case. The author will not be held liable for any damage caused by using the method/(s) described in this article . Use the methods at your own risk. - hardwyrd

Here’s a quick how-to on adding a virtual IP address on OpenSuSE, SLED10, or SLES10. This might be useful for novice users or for advanced users (who happen to forget how to do it :)

1. Open up YAST by clicking on Computer, select Applications tab, More Applications. On SLED10 SP1 and probably on OpenSuSE 10.2 and 10.3, you’ll need to click Computer, make sure the Applications button is clicked, then click on More Applications.

Photo Sharing and Video Hosting at Photobucket

2. In YAST Groups (left pane), click on Network Devices, then click Network Card.

Photo Sharing and Video Hosting at Photobucket

3. In the Network Setup Method dialog, you may choose Network Manager mode or Traditional Method with ifup mode. In my case, I prefer to choose Traditional.

Photo Sharing and Video Hosting at Photobucket

4. After which, the Network Card Configuration Overview will be displayed, with a list of your physical NICs and possibly additional addresses (virtual IPs). Select the NIC you will configure to have additional virtual IP addresses. In most cases, you’ll only have one physical NIC so choose that.

Photo Sharing and Video Hosting at Photobucket

5. After choosing the right NIC, go ahead and click on the Edit button. The Network Address Setup will be displayed. Proceed and click on Advanced and click on Additional Addresses in the pull down menu.

Photo Sharing and Video Hosting at Photobucket

6. In the Additional Addresses dialog, click on the Add button. In the pop up dialog, fill in the Alias Name, IP Address, and Netmask then click OK.

Photo Sharing and Video Hosting at Photobucket

7. Click the OK again, then click Next.

8. Click Finish.

You can verify your virtual IP address is indeed added by opening up your terminal, and going to /etc/sysconfig/network.

# cd /etc/sysconfig/network
# ll
-rw-r--r-- 1 root root 9259 2007-09-08 21:28 config
-rw-r--r-- 1 root root 6707 2007-09-08 21:32 dhcp
-rw-r--r-- 1 root root 558 2007-12-07 09:44 ifcfg-eth-id-00:16:e8:06:9f:8e
-rw-r--r-- 1 root root 141 2007-05-04 19:46 ifcfg-lo
-rw-r--r-- 1 root root 27470 2007-05-04 19:46 ifcfg.template
drwxr-xr-x 2 root root 120 2007-05-03 21:43 if-down.d
-rw-r--r-- 1 root root 239 2007-05-04 19:46 ifroute-lo
drwxr-xr-x 2 root root 208 2007-09-08 21:28 ifservices.template
drwxr-xr-x 2 root root 120 2007-05-03 21:43 if-up.d
drwx------ 2 root root 48 2007-05-03 21:43 providers
-rw-r--r-- 1 root root 27 2007-08-22 16:14 routes
-rw-r--r-- 1 root root 27 2007-08-22 16:14 routes.YaST2save
drwxr-xr-x 2 root root 1496 2007-09-08 21:34 scripts

Your NIC physical NIC will be identified by the format “ifcfg-eth-id-” followed by the MAC address. In our example, our NIC is ifcfg-eth-id-00:16:e8:06:9f:8e. Go ahead and view the content of ifcfg-eth-id-00:16:e8:06:9f:8e.

# less ifcfg-eth-id-00:16:e8:06:9f:8e

You may also use the ifconfig command to display the same information.

# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:e8:06:9f:8e
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fc40::211:edfe:fe12:9c8d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:47040 errors:0 dropped:0 overruns:0 frame:0
TX packets:16575 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15268670 (14.5 Mb) TX bytes:3358248 (3.2 Mb)
Interrupt:193 Base address:0xee00

eth0:172n Link encap:Ethernet HWaddr 00:16:e8:06:9f:8e
inet addr:172.16.1.1 Bcast:172.16.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:193 Base address:0xee00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:939 errors:0 dropped:0 overruns:0 frame:0
TX packets:939 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:91638 (89.4 Kb) TX bytes:91638 (89.4 Kb)

In our example, “eth0:172n” is our interface using our virtual IP address.

If you think this how-to helped you, feel free to leave a comment or a trackback to this article.

Happy SuSEing!

TechnoratiTechnorati: , , , , , , ,
Site Search Tags: , , , , , , ,


1 Comment »

The URI to TrackBack this entry is: http://baudizm.blogsome.com/2007/12/07/adding-virtual-ip-addresses-on-opensuse-sled10-sles10/trackback/

  1. Can you add an alias address to a bonded interface in YAST?

    Do bonded addresses show up in YAST?

    Looking to add alias addresses to a bonded interface to accommodate diskless setup on High Performance Compute servers configured in a computing grid.

    Also, how do you add an alias address via the command line without using YAST (interested in trying to use the CLI to add alias addresses to a bonded interface to see how that works).

    Thanks!

    Comment by Steven Beck — September 12, 2008 @ 12:39 am

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Get free blog up and running in minutes with Blogsome | Theme designs available here