Knowledgebase

Internal IP routing issue

Posted by Red Squirrel, 03-24-2009, 12:05 AM
I have a server that has multiple IPs, one of which I'm using for a VM that is bridged. The issue is, internally, that IP is trying to point to itself rather then the bridged nic (which is technically a whole other server plugged into the same switch, logically). I think I know why, I just don't know how to fix it. This is the config file for the ranges: (edited a few things out just in case) Basically, there's a start and an end, is there a way to exclude an IP?

Posted by eth00, 03-24-2009, 08:14 AM
Exclude an IP for routing? Look at the route command, you can modify the routing tables that way and it should do what you want.

Posted by chaosuk, 03-24-2009, 12:52 PM
you can exclude whatever you like just make the start and end address the same to ensure the subnet is configured upon reboot and to make sure one address from the new range is correctly bound to the host machine then you can freely assign the rest to whatever vps's you like. Dont forget to enable ip forwarding in sysconfig. If the host is windows which im assuming it is not... then dont forget to enable the routing and remote access service. If you want to exlude just one address then start and end 1 address before the one you wish to exclude...then do another config file for the rest of the range after the excluded ip.

Posted by Red Squirrel, 03-24-2009, 01:00 PM
If I make another config, where do is pecify it? I was trying to figure out where this one gets specified so the system knows about it but could not figure it out. Also what would I call it?

Posted by chaosuk, 03-24-2009, 11:49 PM
heres an example based on a centos5 system go into /etc/sysconfig/network-scripts in there you will see files starting with ifcfg-eth0 which will hold your default adapater config. Now this file can have a range specified in it. Secondary ranges get configured in a similar type template in file ifcfg-eth0-range0 with a contents similar to: IPADDR_START=xxx.xxx.xxx.xxx start of the range IPADDR_END=xxx.xxx.xxx.xxx can be full range or single ip CLONENUM_START=1 this tells which virt number to use eth0:1 NETMASK=255.255.255.0 the subnet There ya go. Subsequent ranges, ifcfg-eth0-range1 etc etc create the files if they dont exist. Rememeber this varies upon system as to where these files are located.

Posted by Red Squirrel, 03-25-2009, 12:35 PM
oh so I can specify all that in the main ifcfg file? So would this work? So say I want to skip .23, would the above do what I want? This is a remote server so if I do such changes I want to make sure it wont screw up to the point where I lose my ssh connection. Note that I changed the IPs so it may not make sense for the netmask, but I'm less worried about that part as I'm using assigned IPs.

Posted by chaosuk, 03-25-2009, 04:17 PM
have never tried that way and would not recommend it as you will likely break the network and lock yourself out requiring recover. do the ranges in seperate files so you can keep track of them properly. just go in number order and youll be fine.

Posted by Red Squirrel, 03-25-2009, 05:11 PM
Where do I specify these files? Like do I use some kind of include statement within the main one? I'm not even sure where the existing range file is being specified from. What I'll most likely do is just test this on a local server first, where I have VM console access. Is there also a way I can just specify each IP individually? That would probably be easier then I can pick them out whenever I need them for a VM or something else.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Rockmyweb outage? (Views: 616)
HEEELLLP PLEASEEE!!! (Views: 655)


Language:

Client Login

Email

Password

Remember Me

Search