LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Assign multiple IPs to eth0? (https://www.linuxquestions.org/questions/slackware-14/assign-multiple-ips-to-eth0-4175487173/)

kenw232 12-07-2013 03:47 AM

Assign multiple IPs to eth0?
 
How do I assign multiple IP's to eth0? I edited rc.inet1.conf and did this:

# Config information for eth0:
IPADDR[0]="202.11.193.114"
NETMASK[0]="255.255.255.240"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

# Alias
IPADDR[1]="202.11.193.116"
NETMASK[1]="255.255.255.240"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""

# Config information for eth2:
IPADDR[2]="202.11.193.117"
NETMASK[2]="255.255.255.240"
USE_DHCP[2]=""
DHCP_HOSTNAME[2]=""

GATEWAY="202.11.193.113"


202.11.193.114 still works and is assigned to eth0 and is pingable, but the other two are not. This is under slackware 14.1. Linux central 3.10.18 #11 SMP Wed Dec 4 22:07:20 EST 2013 x86_64.

druuna 12-07-2013 03:59 AM

Its been a while since I used Slackware, but I do believe you need to add IFNAME[A]="ethX:Y"

eth0 is short for eth0:0 and if you want to add multiple IP addresses to this device you use: eth0:1, eth0:2 etc

Looking at the above, try this:
Code:

# Config information for eth0:
IFNAME[0]="eth0"
IPADDR[0]="202.11.193.114"
NETMASK[0]="255.255.255.240"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

# Alias for extremehosting.ca (eth0:1)
IFNAME[1]="eth0:1"
IPADDR[1]="202.11.193.116"
NETMASK[1]="255.255.255.240"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""

# Config information for eth2:
IFNAME[2]="eth2"
IPADDR[2]="202.11.193.117"
NETMASK[2]="255.255.255.240"
USE_DHCP[2]=""
DHCP_HOSTNAME[2]=""



All times are GMT -5. The time now is 09:16 AM.