Re: How do I change IP address dynamically?



On 20 Jun 2006 07:55:36 -0700, linuxlover992000@xxxxxxxxx wrote:
slackware guy wrote:

Red Hat EL (and I assume fedora) has scripts for handling the interface
confguration under
/etc/sysconfig/network-scripts.

The normal practice is to down the interface before making
configuration changes. I haven't
tried reconfiguring an active interface myself but I would prefer (if
not using the scripts) 'ifconfig eth0 down' then make the change then
'ifconfig eth0 up'.


Dean, thanks for your quick reply. What I forgot to mention was that I
am doing this remotely (i.e. via telnet), so the operation has to be
"atomic". That is, by the end of the execution of the command, I have
to be able to access the server again, albeit via a new telnet session
(to the new IP address).

I actually tried just that. I typed in one line:

~> ifconfig eth0 down; ifconfig eth0 192.168.0.31; ifconfig eth0 up

and indeed I was able to telnet again - but the problem I described in
my original posting still persists!

I knew about about RedHat's network-scrips (some of these files are not
really scripts, just plain configuration data such as ifcfg-eth0), but
I thought these are more appropriate for permanent changes.

Any idea how I can *dynamically* (i.e. without needing to reboot and
without needing to use an interactive tool) change the IP address
(within the same subnet - everything else remains the same, including
gateway and DNS) in Fedora?

Please notice that the problem exists only in regard to connecting to
the Internet. Connection within LAN remains OK in any of the ways I
described so far.
...

Other posters have suggested that the default route must be re-done,
but I don't think that's true. However, doing
route -n
before and after will tell.

Perhaps the problem is not in the system that you're changing.
Perhaps it's in the gateway itself.

Can you log into the gateway (I assume it's a router) and look at its
arp cache before and after the change? Can you traceroute or
tracepath from the gateway to changing system before and after (and
from the changing system to the gateway)?

--
Dale Dellutri <ddelQQQlutr@xxxxxxxxxxxx> (lose the Q's)
.



Relevant Pages

  • Re: How do I change IP address dynamically?
    ... Red Hat EL (and I assume fedora) has scripts for handling the interface ... Perhaps it's in the gateway itself. ...
    (comp.os.linux.networking)
  • Re: Liunx and DSL routing
    ... So aaa.aaa.aaa.158 must be the IP address of a Zyxel interface, ... as the "gateway" IP address in the aaa.aaa.aaa.156/30 subnet as well as ... traffic from other hosts to your host and from your host to other hosts. ... the ISP? ...
    (comp.os.linux.networking)
  • Re: firewall script in /etc/ppp/ip-up.d
    ... > after the ppp0 interface comes up. ... manpage on pppd(8) and look for the section on ip-up. ... Your scripts should be able to use these values directly instead of trying to ...
    (comp.os.linux.misc)
  • Re: Unexpected traceroute output over VPN
    ... I am aware that the packet will go from the local machine, ... gateway, to the remote gateway and then to the destination IP. ... encapsulated/encrypted once it enters the inside interface of the local ... ie not while traversing the VPN. ...
    (comp.security.firewalls)
  • Re: Wireless laptop roaming through various access points
    ... Whichever interface has the default route pointing to it, ... It is possible to assign more than one default gateway in the ... What needs to change is the ARP table, which maps the MAC address to ...
    (alt.internet.wireless)