LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-20-2009, 05:20 PM   #1
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 150

Rep: Reputation: 15
Adding New IP to an interface?


Hi guys,

Okay, I'm working on a special project that requires me to add an additional IP to my interface. I have eth2 that is currently running fine and I can ping other machines and send/receive packets.

I try to do:

ifconfig eth2:1 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255

and it seems like it works fine and all, but I can't ping this IP from other machines. I get: connect: Network is unreachable

Now, I tried to add a route to my routing table and I did:
route add -net 192.168.1.0 netmask 255.255.255.0 eth2

Now, when I do a ping, instead of that network unreachable message, I get the PING header information BUT it gets stuck there forever:
> ping 192.168.1.100
PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.


Any idea why this is happening and how I can fix it?

Thanks
 
Old 01-20-2009, 08:24 PM   #2
sparc86
Member
 
Registered: Jul 2006
Location: Joinville, Southern Brazil
Distribution: Debian, CentOS
Posts: 296

Rep: Reputation: 31
It seems pretty weird. But, at first, are you sure there is not any firewall rule which could be blocking input data?
 
Old 01-21-2009, 02:41 PM   #3
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 150

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by sparc86 View Post
It seems pretty weird. But, at first, are you sure there is not any firewall rule which could be blocking input data?
I am behind no firewall. That's for sure. it's an internal network with no access to outside world and therefore no need for a firewall. I know it's weird, that's why I asked for help!

Thanks
 
Old 01-21-2009, 02:48 PM   #4
dudeman41465
Member
 
Registered: Jun 2005
Location: Kentucky
Distribution: Ubuntu
Posts: 794

Rep: Reputation: 56
Are you using a Redhat-ish distro that has SELinux? SE Linux is kind of like a security layer that prevents certain un-authorized system changes. If you do try disabling SELinux temporarily and see if your changes take.
 
Old 01-21-2009, 02:50 PM   #5
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
So you added a route to the network, is there a route back from the network ?

Routing is a two way street.
 
Old 01-21-2009, 03:18 PM   #6
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 150

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by farslayer View Post
So you added a route to the network, is there a route back from the network ?

Routing is a two way street.
No, I guess I thought of it as one way I'll try that...good point.
Thanks very much
 
Old 01-21-2009, 03:28 PM   #7
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
Did you restart your system or restart networking after making the changes to the NIC configuration?
 
Old 01-21-2009, 03:33 PM   #8
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 150

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by AuroraCA View Post
Did you restart your system or restart networking after making the changes to the NIC configuration?
yes i did. thanks
 
  


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
adding a sub interface dave`2005 Slackware 2 11-20-2005 04:16 PM
HELP:Adding a new network interface!!!! tuxuser19 Debian 5 10-29-2005 04:47 AM
adding secondery ip to interface juanb Solaris / OpenSolaris 2 04-14-2005 06:52 AM
Adding a network interface in C/C++ rozeboom Programming 2 03-19-2004 09:33 AM
Adding an interface to commandline Linux tarballedtux Linux - Networking 1 11-15-2001 12:57 PM


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