LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Adding New IP to an interface? (https://www.linuxquestions.org/questions/linux-newbie-8/adding-new-ip-to-an-interface-698679/)

alirezan1 01-20-2009 04:20 PM

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

sparc86 01-20-2009 07:24 PM

It seems pretty weird. But, at first, are you sure there is not any firewall rule which could be blocking input data?

alirezan1 01-21-2009 01:41 PM

Quote:

Originally Posted by sparc86 (Post 3415601)
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

dudeman41465 01-21-2009 01:48 PM

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.

farslayer 01-21-2009 01:50 PM

So you added a route to the network, is there a route back from the network ?

Routing is a two way street.

alirezan1 01-21-2009 02:18 PM

Quote:

Originally Posted by farslayer (Post 3416478)
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

AuroraCA 01-21-2009 02:28 PM

Did you restart your system or restart networking after making the changes to the NIC configuration?

alirezan1 01-21-2009 02:33 PM

Quote:

Originally Posted by AuroraCA (Post 3416518)
Did you restart your system or restart networking after making the changes to the NIC configuration?

yes i did. thanks


All times are GMT -5. The time now is 06:54 PM.