[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to change the IPs for a given NIC permanently ?



Dear All:

	Thank Lee Bradshaw & Hugo van der Merwe reply my questions so quickly, after taking a look at both files " /etc/init.d/network "
and " /etc/pcmcia/network.opts ", I still have the same questions about the IPs:

	1. In my " /etc/init.d/network " simply has two entries :

	    ifconfig lo 127.0.0.1
	    route add -net 127.0.0.0

	2. In my " /etc/pcmcia/network.opts " has following information :

	    case "$ADDRESS" in
	    *,*,*,*)
	            IF_PORT="auto"
	            # Use BOOTP [y/n]
	            BOOTP="n"
	            IPADDR="192.168.1.2"
	            NETMASK="255.255.255.0"
	            NETWORK="192.168.1.0"
	            BROADCAST="192.168.100.255"
	            GATEWAY="192.168.1.254"
	            DOMAIN="birdynest.com.tw"
	            DNS_1="192.168.1.1"
	            ;;
	    esac

	Well, I do use Lap-top to install Debian 2.1,  since the first time installation, I only use one network pc-card, and assign it an IP
address for my home-network, but now I insert the 2nd network pc-card to simulate an router ( sure I re-compile it as an router ).  As soon
as I rebooting the Linux, then I found both eth0, eth1 use the same IP ( 192.168.1.2 witch assigned from the beginning ), at the same
time, I put this Linux router into a different network environment which have totally different subnet from the original home-network, one is
eth0 192.168.2.254 netmask 255.255.255.0 ---> 192.168.2.0/24 another eth1 192.168.3.253 netmask 255.255.255.0 ---> 192.168.3.0/24 , and given this router a default route "0.0.0.0/0.0.0.0 192.168.3.254 :

	|--------------------192.168.2.254 | Linux |192.168.3.253--------------------192.168.3.254|

in order to change IPs to the different NICs, and modify its routing table, I issue following command:

ifconfig eth0 192.168.2.254 broadcast ....... netmask .......
route add -net 192.168.2.0 netmask ...... eth0
ifconfig eth1 192.168.3.253 broadcast ....... netmask .......
route add -net 192.168.3.0 netmask ...... eth0
route add default gw 192.168.3.254

of cause it will lost when the Linux have to reboot,  so, should I modify the /etc/init.d/network via inserting these commands or what to do
with the /etc/pcmcia/network.opts ?  which file is actually referenced during booting processes, or,  overwrite the configuration after
booting completely ?

	Finally, those information, such like hostname, domain name, dns, ..... etc., which files should to be modified ?

									Thanks !
									Nazareth Shu
									shu@ms5.url.com.tw
									Jun. 7, 2000



Reply to: