Pedros wrote:
> Hi,
> propably an easy question but could someone tell me how to change ip address
> for eth1 without having to restart the interface. ...
Ie., you want to delete the _primary_address_ on eth1 -- which will
automatically clear the sub-interface addresses. What do you want to
do with the sub-interface addresses? Continue to use them as is?
Change them to sub-interface addresses of the _new_primary_ address?
> ... That interface has 7
> (eth1.2-eth1.8) subinterfaces and I relally wouldn't like to shutdown all
> the subinterfaces to change the ip for eth1.
As soon as you delete the primary address the sub-interface (secondary)
addresses will clear.
> does
> "ifconfig eth1 new.ip.address.ress netmask 255.255.255.0 broadcast
> new.ip.add.255 up"
> do the thing, without interfearing to functionality of other interfaces?
Can't remember about ifconfig behavior. But with something like:
# ip address add 192.168.100.0/24 brd + dev eth1
You would _add_ a new address without affecting others. IF it is
_also_ in the same subnet space as an _existing_ address, it will be a
secondary address (sub-interface).
> Does it affect to routing table any way else but what the new ip causes?
As soon as you delete _any_ address, there are likely side
affects/deletions in the route table cache (arp cache also?) -- I can't
recall offhand :-(
OTOH,
# ip address flush dev eth1
would _definitely_ clear _all_ addresses from eth1 _and_ clean up the
caches.
> The distro is Fedora Core 1
The ip utility if much more flexible/capable than ifconfig. In fact,
if you look at your network startup scripts you will see that they
using ip commands ;-)
IF you are adding a new address to eth1 that is _unrelated_ to existing
addresses and the present secondary addresses are to be changed to
become secondary addresses of the _new_ address, then you could add the
new addresses first, then delete the old primary address (which will
clear the secondaries automaticall).
The side affects on _current_ connections and cached arp/route table
entries on _this_ machine you can control somewhat, but the same cached
info on other machines will have to time out before the old info
clears. Side effects? Could range from barely noticed to an office
riot of screams ;-)
Check these two site links on how you can overcome these quirks of
secondary addresses using ip commands. Be warned, it may be more work
than you care for till you get comfortable with ip commands.
http://linux-ip.net/html/
http://linux-ip.net/html/basic-changing.html
http://linux-ip.net/html/tools-ip-management.html
http://www.policyrouting.org/iproute2-toc.html
hth and good luck,
prg