Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Servers & Networking
FedoraForum Search

Forgot Password? Join Us!

Servers & Networking Discuss any Fedora server problems and Networking issues such as dhcp, IP numbers, wlan, modems, etc.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 17th January 2007, 01:55 AM
damoose Offline
Registered User
 
Join Date: Jan 2007
Posts: 6
Exclamation URGENT!!: FC2 doesn't take IP address from command line, only GUI(Network Window).

Hi there,

I SSH to our servers remotely and want to change the IP address of the server on the fly.

Current IP config:

Server 1.
eth0 10.2.3.3 netmask 255.255.255.0 broadcast 10.2.3.255

alias:
eth0:0 10.2.3.33 netmask 255.255.255.0 broadcast 10.2.3.255


Server 2.
eth0 10.2.3.4 netmask 255.255.255.0 broadcast 10.2.3.255

alias:
eth0:0 10.2.3.44 netmask 255.255.255.0 broadcast 10.2.3.255

I SSH to the alias of Server 2, and want to change the actual IP, 10.2.3.4, to 10.2.3.5

So I typed:

ifconfig eth0 10.2.3.3 netmask 255.255.255.0 broadcast 10.2.3.255 [enter]

Lost connection.


So when I was there locally, I logged in to the console, and saw it accepted the IP able to ping other host on the same network. Not if I try to SSH from Public (remote VPN client, and VPN connection from firewalls).

But when I restarted the network service (/etc/init.d/network restart) it goes BACK to the IP address that I entered in on the Network GUI interface (Hat -> System Configurations -> Network -> eth0 -> Edit).

We tried editing /etc/rc.d/rc.local file by putting the IP there, eth1, eth2, disable eth0 and .... nothing!!.

It will only accept PERMANENTLY when I make the change in Network GUI interface -> Activate -> restart the network interface. AND only will I then be able to connnect to it via SSH from public side.

Please Help Me! I am desperate here! Thank you!
Reply With Quote
  #2  
Old 17th January 2007, 02:05 AM
hiberphoptik's Avatar
hiberphoptik Offline
Registered User
 
Join Date: Apr 2004
Posts: 1,186
using those commands it will never keep the settings after a restart, if you wnt to change them yuo can edit the scripts in /etc/sysconfig/network-scripts/
Reply With Quote
  #3  
Old 17th January 2007, 02:22 AM
marko's Avatar
marko Online
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 5,446
Quote:
Originally Posted by damoose
Hi there,
...........
So when I was there locally, I logged in to the console, and saw it accepted the IP able to ping other host on the same network. Not if I try to SSH from Public (remote VPN client, and VPN connection from firewalls).

But when I restarted the network service (/etc/init.d/network restart) it goes BACK to the IP address that I entered in on the Network GUI interface (Hat -> System Configurations -> Network -> eth0 -> Edit).

We tried editing /etc/rc.d/rc.local file by putting the IP there, eth1, eth2, disable eth0 and .... nothing!!.

It will only accept PERMANENTLY when I make the change in Network GUI interface -> Activate -> restart the network interface. AND only will I then be able to connnect to it via SSH from public side.

Please Help Me! I am desperate here! Thank you!
/etc/init.d/network restart gets the addresses and network info it
needs from the files
/etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-*

That's why doing the restart reverts you back to the settings you put in
via the gui. I'm not totally sure what you want to do but you can quickly
change the addresses on a interface via a console

ifconfig eth0 IPADDRESS

like:
ifconfig eth0 192.168.1.200

but like you found these are one-shot settings, the next reboot or
network restart they are gone and revert back to your original settings.
If you want these to be permanent, you can edit
the /etc/sysconfig/network-scripts/ifcfg-eth? file(s)

Mark

Last edited by marko; 18th January 2007 at 05:44 AM.
Reply With Quote
  #4  
Old 17th January 2007, 02:49 AM
damoose Offline
Registered User
 
Join Date: Jan 2007
Posts: 6
Thanks for the suggestions Mark. I'll try that.

The reason I'm doing this way is actually to replace the role of Server 1(MAIN) with Server 2(BACKUP).

So if Server 1(MAIN) is down (10.2.3.3), then I will simply SSH to Server 2 IP alias(10.2.3.44) and make its actual IP to be the MAIN server.

Will I lose connection this way, though I'm connecting through the IP alias?..

further explanation:
Reading at your suggestion on editing the /etc/sysconfig/network-scripts/ifcfg-eth? file(s) -->>
If I edit ifcfg-eth0 file of the BACKUP server to be the IP of the MAIN server will I lose my SSH connection since I'm connecting through the BACKUP server IP alias ?..

Thank you guys.
Reply With Quote
  #5  
Old 17th January 2007, 04:07 PM
damoose Offline
Registered User
 
Join Date: Jan 2007
Posts: 6
What Mark suggested is working!.
I edited the /etc/sysconfig/network-scripts/ifcfg-eth0 file , changed the

IPADDR=10.2.3.3 (AFTER the change).

save, and restart network service --> /etc/init.d/network restart

Voila it accepted the actual IP. HOWEVER, I lost connection since I logged in through the IP alias.
I configured the IP alias by typing it manually on command line:

ifconfig eth0:0 10.2.3.88 netmask 255.255.255.0 broadcast 10.2.3.255

and I entered it in /etc/rc.d/rc.local file. This way when I reboot it will still keep the IP alias.

So my next question is, is there anyway to KEEP the IP ALIAS configuration without rebooting?..

Is there a "hard code" parameter in /etc/sysconfig/network-scripts/ifcfg-eth0 file ? Maybe something like IPADDR-ALIAS or something.

I noticed there's a file call etc/sysconfig/network-scripts/ifup-aliases. Could I edit something in there so I don't need to reboot the server in order for me to login via IP ALIAS address?
Reply With Quote
Reply

Tags
address, command, fc2, guinetwork, line, urgent, window

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I discover my WAN address on command line? RobinQi Servers & Networking 10 28th October 2008 06:35 AM
Switching window managers from command line GammaPoint Using Fedora 0 6th January 2008 05:06 AM
URGENT!!: FC2 doesn't take IP address from command line, only GUI(Network Window). damoose Servers & Networking 3 17th January 2007 02:25 AM
How to address an smb share from the command line lozd Servers & Networking 4 11th April 2006 02:54 PM


Current GMT-time: 08:28 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat