LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-19-2006, 03:27 AM   #1
baambooli
LQ Newbie
 
Registered: May 2006
Distribution: ubuntu , Win XP
Posts: 29

Rep: Reputation: 15
setting 2 IP for eth0 in slack


hi how can i set 2 ip address to one NIC card and apply new settings without restarting the slackware?
 
Old 06-19-2006, 03:41 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,214
Blog Entries: 1

Rep: Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067
You can run:
Code:
ifconfig eth0:0 x.x.x.x netmask y.y.y.y up
 
Old 06-19-2006, 05:07 AM   #3
baambooli
LQ Newbie
 
Registered: May 2006
Distribution: ubuntu , Win XP
Posts: 29

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory
You can run:
Code:
ifconfig eth0:0 x.x.x.x netmask y.y.y.y up
thanks a lot. but i have read that ifconfig settings are not permanent and after restarting linux, it will not work. is it ture?
 
Old 06-19-2006, 05:18 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,214
Blog Entries: 1

Rep: Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067
Quote:
ifconfig settings are not permanent and after restarting linux, it will not work. is it ture?
It's true. You will lose the settings when you reboot. But you can add the ifconfig command to your init srcipts, e.g. to /etc/rc.d/rc.local, so there will be no need to re-enter it:
Code:
/sbin/ifconfig  eth0:0 x.x.x.x netmask y.y.y.y up
 
Old 06-19-2006, 07:14 AM   #5
baambooli
LQ Newbie
 
Registered: May 2006
Distribution: ubuntu , Win XP
Posts: 29

Original Poster
Rep: Reputation: 15
thanks a lot .
 
Old 06-19-2006, 07:47 AM   #6
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116
Much cleaner is adding these lines to /etc/rc.d/rc.inet1.conf where the network configuration for your eth0 is done too:
Code:
# Config information for eth0:0
IFNAME[1]="eth0:0"
IPADDR[1]="XXX.XXX.XXX.XXX"
NETMASK[1]="YYY.YYY.YYY.YYY"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""
After which you can run
Code:
/etc/rc.d/rc.inet1 eth0:0_start
to start the interface. And it will automatically be configured and started on boot.

Change the XXX.XXX.XXX.XXX and YYY.YYY.YYY.YYY to your TCPIP parameters.

Eric
 
  


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
Slack 10.2: eth0 and es1371 missing Pier Slackware 11 11-02-2005 02:11 AM
eth0 and pointopoint setting merovingian Linux - Networking 0 09-13-2003 10:38 PM
Slack 8.0 Eth0 woes clar77 Linux - Networking 2 05-27-2002 07:32 AM
Setting Up Redhat 7.0 Eth0 and Eth1 =/ cpender Linux - Networking 1 02-22-2002 02:32 AM
Help with setting up eth0 thechronic Linux - Newbie 1 02-07-2002 09:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:30 AM.

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