Sponsored Content
Special Forums IP Networking Script to assign mutiple IP's to 1 nic Post 302246419 by mike171562 on Monday 13th of October 2008 04:33:54 PM
Old 10-13-2008
Quote:
Originally Posted by sysgate
one NIC can't have more than one IP address assigned, the "inet addr" section may accept only one IP. Are you looking for dhcp ?
This can be done using aliases..

on FreeBSD add something like this to your /etc/rc.conf


ifconfig_rl0="inet 192.168.x.xxx netmask 255.255.255.0"
hostname="yourhostnamet"
ifconfig_rl0_alias0="192.168.x.xxx netmask 255.255.255.0"

on Linux heres a howto

http://www.linuxselfhelp.com/HOWTO/mini/IP-Alias/
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to check for the newest file mutiple times a day and SCP it to another server.

Hi, I need a sample of a script that will check a specific directory multiple times throughout the day, and scp the newest file to another server. Example: current file is misc_file.txt_02272011 (the last part is the date), once that has been secure copied, another one may come in later the... (1 Reply)
Discussion started by: richasmi
1 Replies

2. Solaris

x86 Solaris 10 nic driver added but not attached. NIC is not detected.

I couldn't install my nic in solaris 10. I compiled and added the driver but failed to attach the driver and ifconfig output shows only loopback dev. Please see the following output and tell me whether my nic has been detected and why the driver failed to attach? My nic is detected in linux... (0 Replies)
Discussion started by: vectrum
0 Replies

3. IP Networking

squid proxy: one NIC for inbound & one NIC for outbound?

I am new in squid proxy. My question is how to (and if it's necessary) to set one NIC for inbound traffic (http requests) and one NIC for outbound traffic (http answers)? Thank you in advance! (4 Replies)
Discussion started by: aixlover
4 Replies

4. Shell Programming and Scripting

Need a script to add mutiple printers in solaris box

Hi , i need to configure around 80 printers in a server. can someone please help me with the script. i have a file that has printer name and its ip. like. printer1 1.1.1.1 printer2 0.0.0.0 and so on.. can some one please help me to do it via script. i am using solaris 10 ... (0 Replies)
Discussion started by: chidori
0 Replies

5. Red Hat

I want to tune NIC's rps, rfs and xps value. which NIC device should I modify.

Dear All I want tune my NIC's rps, rfs and xps value. In my system I have two NIC (eth0, eth1) and I have a bond0 ( eth0, eth1). Here is the question? Which device should I modify ? eth0 and eth1? or just modify bond0 or modify all device (eth0, eth1, bond0) Any advice is welcome.... (0 Replies)
Discussion started by: nnnnnnine
0 Replies

6. UNIX for Dummies Questions & Answers

awk script combining mutiple commands

Hi, I am pretty new to the unix community and have encountered a problem that I am trying to solve. I have 2 files one of which is called passwd file that looks like the following Sample Output daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh ... (1 Reply)
Discussion started by: raven905
1 Replies

7. Shell Programming and Scripting

Shell script with mutiple steps/commands, on UNIX servers

Hi, I wrote a simple script, which will call other scripts or run commands on a UNIX server. my script has multiple steps/commands with some delay in between. I usually get some email notifications after the successful execution of each step. **My intention is to get email alerts when it is... (5 Replies)
Discussion started by: System Admin 77
5 Replies

8. Linux

Add two different subnet public IPs to single NIC or two different NIC on same box

Hello Admins, My ask is how can I add two different subnet IPs to same box with two different gateways? The issue is I can connect to the box when I am on ethernet LAN, but I am not able to connect to the same IP when I am on wifi. The server is RHEL 7 VM on vmware. How can I get connected... (4 Replies)
Discussion started by: snchaudhari2
4 Replies

9. Shell Programming and Scripting

Writing single script with mutiple sbatch parts

Hello, I wrote several scripts that work with job arrays (sbatch) that look like this: #!/bin/bash #SBATCH --partition=carl.p #SBATCH --ntasks=4 #SBATCH --time=0-10:00 #SBATCH --mem-per-cpu=48G #SBATCH --job-name=basic_test #SBATCH --mail-type=END,FAIL #SBATCH --mail-user= #SBATCH... (2 Replies)
Discussion started by: idbemad
2 Replies

10. UNIX for Beginners Questions & Answers

How to ignore mutiple strings when using shell script?

Hi All, I am trying to use below syntax to find ignore multiple locations while searching for a file. find / -name "$serviceitem" ! -size 0 2>&1 |egrep -v "tmp|docker|WinSxS|Permission|HISTORY|alternatives|bearer11ssl|manifest" I tried to assign all the ignore strings to one variable... (2 Replies)
Discussion started by: sravani25
2 Replies
OCF_HEARTBEAT_IPADDR(7) 					OCF resource agents					   OCF_HEARTBEAT_IPADDR(7)

NAME
ocf_heartbeat_IPaddr2 - Manages virtual IPv4 and IPv6 addresses (Linux specific version) SYNOPSIS
IPaddr2 [start | stop | status | monitor | meta-data | validate-all] DESCRIPTION
This Linux-specific resource manages IP alias IP addresses. It can add an IP alias, or remove one. In addition, it can implement Cluster Alias IP functionality if invoked as a clone resource. If used as a clone, you should explicitly set clone-node-max >= 2, and/or clone-max < number of nodes. In case of node failure, clone instances need to be re-allocated on surviving nodes. This would not be possible if there is already an instance on those nodes, and clone-node-max=1 (which is the default). SUPPORTED PARAMETERS
ip The IPv4 (dotted quad notation) or IPv6 address (colon hexadecimal notation) example IPv4 "192.168.1.1". example IPv6 "2001:db8:DC28:0:0:FC57:D4C8:1FFF". (unique, required, string, no default) nic The base network interface on which the IP address will be brought online. If left empty, the script will try and determine this from the routing table. Do NOT specify an alias interface in the form eth0:1 or anything here; rather, specify the base interface only. If you want a label, see the iflabel parameter. Prerequisite: There must be at least one static IP address, which is not managed by the cluster, assigned to the network interface. If you can not assign any static IP address on the interface, modify this kernel parameter: sysctl -w net.ipv4.conf.all.promote_secondaries=1 # (or per device) (optional, string, no default) cidr_netmask The netmask for the interface in CIDR format (e.g., 24 and not 255.255.255.0) If unspecified, the script will also try to determine this from the routing table. (optional, string, no default) broadcast Broadcast address associated with the IP. If left empty, the script will determine this from the netmask. (optional, string, no default) iflabel You can specify an additional label for your IP address here. This label is appended to your interface name. A label can be specified in nic parameter but it is deprecated. If a label is specified in nic name, this parameter has no effect. (optional, string, no default) lvs_support Enable support for LVS Direct Routing configurations. In case a IP address is stopped, only move it to the loopback device to allow the local node to continue to service requests, but no longer advertise it on the network. Notes for IPv6: It is not necessary to enable this option on IPv6. Instead, enable 'lvs_ipv6_addrlabel' option for LVS-DR usage on IPv6. (optional, boolean, default false) lvs_ipv6_addrlabel Enable adding IPv6 address label so IPv6 traffic originating from the address's interface does not use this address as the source. This is necessary for LVS-DR health checks to realservers to work. Without it, the most recently added IPv6 address (probably the address added by IPaddr2) will be used as the source address for IPv6 traffic from that interface and since that address exists on loopback on the realservers, the realserver response to pings/connections will never leave its loopback. See RFC3484 for the detail of the source address selection. See also 'lvs_ipv6_addrlabel_value' parameter. (optional, boolean, default false) lvs_ipv6_addrlabel_value Specify IPv6 address label value used when 'lvs_ipv6_addrlabel' is enabled. The value should be an unused label in the policy table which is shown by 'ip addrlabel list' command. You would rarely need to change this parameter. (optional, integer, default 99) mac Set the interface MAC address explicitly. Currently only used in case of the Cluster IP Alias. Leave empty to chose automatically. (optional, string, no default) clusterip_hash Specify the hashing algorithm used for the Cluster IP functionality. (optional, string, default "sourceip-sourceport") unique_clone_address If true, add the clone ID to the supplied value of IP to create a unique address to manage (optional, boolean, default false) arp_interval Specify the interval between unsolicited ARP packets in milliseconds. (optional, integer, default 200) arp_count Number of unsolicited ARP packets to send. (optional, integer, default 5) arp_bg Whether or not to send the ARP packets in the background. (optional, string, default "true") arp_mac MAC address to send the ARP packets to. You really shouldn't be touching this. (optional, string, default "ffffffffffff") arp_sender The program to send ARP packets with on start. For infiniband interfaces, default is ipoibarping. If ipoibarping is not available, set this to send_arp. (optional, string, no default) flush_routes Flush the routing table on stop. This is for applications which use the cluster IP address and which run on the same physical host that the IP address lives on. The Linux kernel may force that application to take a shortcut to the local loopback interface, instead of the interface the address is really bound to. Under those circumstances, an application may, somewhat unexpectedly, continue to use connections for some time even after the IP address is deconfigured. Set this parameter in order to immediately disable said shortcut when the IP address goes away. (optional, boolean, default false) SUPPORTED ACTIONS
This resource agent supports the following actions (operations): start Starts the resource. Suggested minimum timeout: 20s. stop Stops the resource. Suggested minimum timeout: 20s. status Performs a status check. Suggested minimum timeout: 20s. Suggested interval: 10s. monitor Performs a detailed status check. Suggested minimum timeout: 20s. Suggested interval: 10s. meta-data Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s. validate-all Performs a validation of the resource configuration. Suggested minimum timeout: 20s. EXAMPLE
The following is an example configuration for a IPaddr2 resource using the crm(8) shell: primitive p_IPaddr2 ocf:heartbeat:IPaddr2 params ip=string op monitor depth="0" timeout="20s" interval="10s" SEE ALSO
http://www.linux-ha.org/wiki/IPaddr2_(resource_agent) AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors) resource-agents UNKNOWN 06/09/2014 OCF_HEARTBEAT_IPADDR(7)
All times are GMT -4. The time now is 11:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy