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

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



On Wed, Jun 07, 2000 at 12:22:46AM +0800, Nazareth Shu wrote:
> 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

I thought you were using a desktop machine when you asked about two
network cards. This network file looks ok for a laptop.

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

On my potato laptop, there is a comment:

# The address format is "scheme,socket,instance,hwaddr".

You could try something like

  case "$ADDRESS" in
  *,*,*,MAC_ADDRESS_FOR_ETH0) # replace MAC_ADD... with the real MAC address
    IF_PORT="auto"
    BOOTP="n"
    IP_ADDR="192.168.2.254"
    NETMASK="255.255.255.0"
    ...
    ;;
  *,*,*,MAC_ADDRESS_FOR_ETH1)
    IF_PORT="auto"
    BOOTP="n"
    IP_ADDR="192.168.3.253"
    ...
    GATEWAY="192.168.3.254"
    ...
    ;;
  esac

I don't know what format the MAC address is in. You may want to insert
an echo $ADDRESS to see what it looks like.

Fill in the extra lines for ... 
> 
> 	    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
> 
> 
> --  
> To UNSUBSCRIBE, email to debian-laptop-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 

-- 
Lee Bradshaw                 lee@sectionIV.com (preferred)
Alantro Communications       lee@alantro.com



Reply to: