LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   howto delete existing static ip of ethernet(eth0)& reconf multiple ips on eth0 (http://www.linuxquestions.org/questions/linux-networking-3/howto-delete-existing-static-ip-of-ethernet-eth0-and-reconf-multiple-ips-on-eth0-140913/)

viveku 02-01-2004 02:06 AM

howto delete existing static ip of ethernet(eth0)& reconf multiple ips on eth0
 
i am configuring a linux(redhat8) server with five different ip schemes on a single ethernet card i.e. eth0. with one public ip for internet access.

all the ip addresses are of different subnet but all belong to class c.

i have only one linux machine as a server and all the clients are windows xp or 98 based.

i assigned some wrong ip schemes on my ethernet card eth0 as eth0 and eth0:1 now i want to delete these two schemes and reconfigure this eth0 for all new five different ip schemes with one static ip address on eth0.

pls guide me to delete this ip scheme and reconfigure all five different ip schemes and one public ip on my single ethernet card eth0.

i will be thankful to you.
waiting for your reply

kind regards
viveku

my e mail id : vivekupadhyay80@yahoo.co.uk

Homer Jay 02-01-2004 07:36 PM

hi.
I assume you want to use the rh-box as file/print/whatever-server and
internet-gateway. For all of that, you need just one ip-address.
ifconfig eth0 down should switch off your ethernet card (maybe you
also need ifconfig eth0:1 down, i've never used that eth0:1 stuff).
ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up will bring it up
again.

Once ping 192.168.0.1 works on those w*-clients, your have a
fileserver (provided that samba is properly installed).

To give 'em the net, you need Masquerading. If you're lucky,
echo 1 > /proc/sys/net/ipv4/ip_forward is all it takes (but more
likely you'll have to read Linux IP Masquerade HOWTO and/or
Linux Networking HOWTO).

Then tell w* to use 192.168.0.1 as gateway (or default-route, dunno how
they call it). If you have a large number of clients, you might like to set
up a dhcp-server on your rh-box (see DHCP mini-HOWTO).
That should tell the clients which gateway to use, so you don't have to
run around to configure every rotten windoze-box.

Hope that helps.

coolamit78 02-02-2004 02:30 AM

Hi...

delete the following files

/etc/sysconfig/network-scripts/ifcfg-eth0

/etc/sysconfig/network-scripts/ifcfg-eth0:1

use 'netconfig' command to configure your first network interface eth0.

Now..

If you want to create a chain of IP addresses, use this following method

1. Create a file

/etc/sysconfig/network-scripts/ifcfg-eth0-range0

2. In this file, put

DEVICE=eth0-range0
BOOTPROTO=static
IPADDR_START=192.168.1.1
IPADDR_END=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
CLONENUM_START=1

3. as root, give the command

service network restart

{ Similarly, you can create multiple range files {ifcfg-eth0-range1, ifcfg-eth0-range2..and so on...using the above method. Only thing to note is, a maximum of 256 IP addresses can be bound to a single NIC }

Regards,

amit


All times are GMT -5. The time now is 12:29 AM.