LinuxQuestions.org
Help answer threads with 0 replies.
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


Closed Thread
  Search this Thread
Old 05-24-2005, 03:20 AM   #1
seb22
LQ Newbie
 
Registered: May 2005
Posts: 3

Rep: Reputation: 0
Linux command to assign an ip address


Hi everyone

I am Saira Babu and i am studying computer science. Here is my question: You are logged in to a machine called monroe,it has two ethernet cards, the first card is already configured with ip address 192.168.200.104.

Give a Linux command to assign an ip address of 192.168.22.158 to the second card

Give another command to add a default gateway (with ip address 192.168.22.1) to your routing table
 
Old 05-24-2005, 03:33 AM   #2
linuxcolor
LQ Newbie
 
Registered: Feb 2005
Location: Bangladesh
Distribution: Fedora 11
Posts: 26

Rep: Reputation: 15
assign IP

U need to use the following command for second nic card

#netconfig -d eth1


for default gateway

#route add gw 192.168.22.1
 
Old 05-24-2005, 04:38 AM   #3
seb22
LQ Newbie
 
Registered: May 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks 4 ur reply

i just want to clarify one thing.i emailed the same question to someone else and his answer is as follows:

command 4 second ethernet card:

/sbin/ifconfig eth1 192.160.22.158

for default gateway

sbin/route add default gw 192.168.22.1

so are both ur's and his answers the same ?

please reply
 
Old 05-24-2005, 04:47 AM   #4
linuxcolor
LQ Newbie
 
Registered: Feb 2005
Location: Bangladesh
Distribution: Fedora 11
Posts: 26

Rep: Reputation: 15
yes both are same but small differance...
At first which distribution u use...
In redhat/fedora u can use the command..

for u r second nic card u can use the command
/sbin/ifconfig eth1 192.160.22.158
but it's temporary solution., that means when u reboot the machine ,second nic card ip address empty again.

so ..

#netconfig -d eth1

then

#service network restart

it is the parmanent solution.
 
Old 05-24-2005, 09:02 AM   #5
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Moved: This thread is more suitable in Linux-Networking and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 05-24-2005, 12:03 PM   #6
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Seb22 - we are not your homework site. If we give you the answers we are working against your teachers who are trying to get you to learn. We are, therefore, doing you and your school a disservice. The point of you getting homework is so that you can reinforce what you have been told at school and so you can learn to research answers on your own. The point of an exam is so that you can prove that you have taken in and understood the subject.

It is explicitly written that you should not ask us to do your homework for you.
 
  


Closed Thread



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
Ssh tunnel : cannot assign requested address sieker Linux - Networking 6 11-11-2005 01:10 PM
Can not assign IP address jtir Solaris / OpenSolaris 1 09-28-2005 03:37 AM
Linux command to assign an ip address seb22 LinuxQuestions.org Member Intro 2 06-12-2005 02:19 AM
Can't assign a static IPv6 address guzo Linux - Networking 0 02-11-2005 06:22 AM
USB foto can't assign address ivanatora Linux - Hardware 1 06-25-2004 02:10 PM

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

All times are GMT -5. The time now is 05:11 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
Open Source Consulting | Domain Registration