LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-05-2015, 02:39 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 11
Post Assign different/multiple IP address to NIC network card


Hello.
I use Debian Jessie and I want to know how can I add another IP addresses to my NIC for support other networks?

Tnx.
 
Old 11-05-2015, 06:29 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
While I don't know Debian, this works on any relatively new Linux platform:
Code:
ip addr add 192.168.1.123/24 dev eth0
When you are tired of the IP address, you can remove it as well:
Code:
ip addr del 192.168.1.123/24 dev eth0
To list all your ip addresses:
Code:
ip a
or
Code:
ip a s dev eth0
I love the succinctness of these command.

Don't forget the CIDR prefix (why is it called prefix if it's at the end?) /24 or whatever is correct in your environment. It will be used to build a matching routing table entry; if you leave it out, /32 is assumed.

Last edited by berndbausch; 11-05-2015 at 06:31 AM.
 
  


Reply



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
can I assign a multicast address in the /etc/network/interfaces file baronobeefdip Linux - Networking 6 06-24-2015 12:11 PM
how to assign an alternate ip address on same lan card fahedakhter Linux - Networking 2 07-10-2010 04:52 PM
how to assign an alternate ip address on same lan card fahedakhter Linux - Server 5 07-10-2010 12:46 PM
How to assign IP address to 2nd ethernet card gardenair Linux - Newbie 8 06-22-2010 07:47 AM
Multiple IP addresses on one NIC: "Cannot assign requested address" error cpbl Linux - Server 5 06-10-2009 03:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:35 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