LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-19-2016, 02:27 PM   #1
kohshan99
Member
 
Registered: Sep 2012
Posts: 50

Rep: Reputation: Disabled
Question temporary Ip address


how to add temporary ip address? right now
Quote:
root@HP-Z400-Workstation:~# ifconfig
eth1 Link encap:Ethernet HWaddr d0:50:99:0f:9c:9e
inet addr:192.168.172.131 Bcast:192.168.172.135 Mask:255.255.255.248
inet6 addr: fe80::d250:99ff:fe0f:9c9e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1411930572 errors:0 dropped:0 overruns:0 frame:0
TX packets:2256205206 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:127270888272 (127.2 GB) TX bytes:1562113750858 (1.5 TB)

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:65536 Metric:1
RX packets:15952 errors:0 dropped:0 overruns:0 frame:0
TX packets:15952 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2434458 (2.4 MB) TX bytes:2434458 (2.4 MB)
but when i add temporary ip address, getting this error
Quote:
root@HP-Z400-Workstation:~# ip address add 202.175.165.124 dev eth0:0
Cannot find device "eth0:0"

Last edited by kohshan99; 05-19-2016 at 02:36 PM. Reason: spelling mistake
 
Old 05-19-2016, 03:18 PM   #2
lazydog
Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 778
Blog Entries: 1

Rep: Reputation: 123Reputation: 123
Copy ifcfg-eth0 to ifcfg-eth0:0 and change the ip address. Then run ifup eth0:0
 
Old 05-19-2016, 04:04 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,937

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
The syntax is different when using the ip versus ifconfig commands. You can add multiple addresses without them being an "alias". Since eth0 was not shown in the output of the ifconfig is it enabled? You can add a temp address like below. Change the numbers to match your network.

ip addr add 192.168.0.2/24 brd 192.168.0.255 dev eth0

To see eth0:0 when using the ifconfig command:
ip addr add 192.168.0.2/24 brd 192.168.0.255 dev eth0 label eth0:0
 
Old 05-20-2016, 03:30 AM   #4
kohshan99
Member
 
Registered: Sep 2012
Posts: 50

Original Poster
Rep: Reputation: Disabled
thanks to everyone.
i solved it by just changing eth0:0 to eth1:0. because my primary ip interface is on eth1 so i can use eth1:0 to eth1:1, eth1:2, eth1:3.

like this
Quote:
root@HP-Z400-Workstation:~# ip address add 202.175.165.124 dev eth1:0

Last edited by kohshan99; 05-20-2016 at 03:32 AM. Reason: command
 
  


Reply

Tags
network interface, network manager, ubuntu


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
[SOLVED] Changing the IP address of the primary DNS. Susiedc3 Linux - Newbie 3 07-21-2011 01:49 PM
Router gateway address being picked up as primary DNS address under SuSe Hubmasterflex Linux - Networking 13 10-18-2008 02:40 PM


All times are GMT -5. The time now is 01:12 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration