:: [linux] Setting up two nic's on RH 7.2 ::
HOME


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

[linux] Setting up two nic's on RH 7.2


Yesterday i tried setting up two nic's in my RH 7.2 system. Below are the logs of the things that need to be done.,
 
1. Make sure that kundzu is turned on as a service.. This is an application to detect new hardware installed in the system,
2. cd /etc/sysconfig/network-scripts
3. There u will see ifcfg-eth0 and ifcfg-lo.The contents of which are shown below
 
[shashank]# cat ifcfg-eth0
DEVICE=eth0
>BOOTPROTO=static
IPADDR=131.193.MM.AA
NETMASK=255.255.255.0
GATEWAY=131.193.MM.1
TYPE=Ethernet
USERCTL=no
NETWORK=131.193.MM.0
BROADCAST=131.193.MM.255
PEERDNS=no
[shashank]# cat ifcfg-lo
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
>NAME=loopback
 
4. now use the copy command to create a new file
cp ipcfg-eth0 ifcfg-eth1
 
5. Open ifcfg-eth1 and change the IPADDR, GATEWAY etc.. a sample is provided below.
*********This is very important.. The gateway  should be the IPAddr
DEVICE=eth1
>BOOTPROTO=static
IPADDR=192.168.0.1
NETMASK=255.255.255.0
GATEWAY=131.193.MM.AA 

TYPE=Ethernet
USERCTL=no
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
PEERDNS=no
 
6. Shutdown the computer. ****Remove the OLD network card******
The above is important, if you want the old network card to preserve the IP address.. This was important to us as the switch in our lab is being configured with the MAC of old NIC and hence will only accept packet from the OLD nic..
I tried installing the new card without removing the old,.. but RH has some wierd way of assigning the cards,, It will make the OLD nic as eth1 (for the private network) and transfer the configuration of eth0 to the new NIC, which in my case does not do me any good.
 
 
7. Restart the computer without any NIC.. Kudzu will ask you if you need to remove the configuration,..
Just say YES>
 
8. Shutdown the computer again..
 
9. Insert ONLY the NEW NIC first and start the computer
 
10. Again Kudzu will detect the new card ans ask you if you want to transfer the old settings..
Jsut say yes..
 
11. At this point after the system starts,if you do ifconfig -a, u will see that the new card has been assigned the interface eth0 and Public IP addr. (You don't want this.)
 
 
12 stutdown the computer again. and insert the OLD card.. Again restart
 
13.. Again kudzu detects it.. and asks you if you want to tranfer the current settings..
say yes..
 
14.. Now when the comp starts do an
ifup eth1
 
15.. Finally you will see the following when you do ifconfig -a
 
eth0      Link encap:Ethernet  HWaddr 00:C0:A8:7F:18:6B  --(OLD)
          inet addr:131.193.MM.AA  Bcast:131.193.MM.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:56887 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20150 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:24563411 (23.4 Mb)  TX bytes:2678551 (2.5 Mb)
          Interrupt:3 Base address:0x7800
 
eth1      Link encap:Ethernet  HWaddr 00:30:BD:03:2B:5C  --(NEW)
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24591 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27444 errors:0 dropped:0 overruns:0 carrier:0
          collisions:819 txqueuelen:100
          RX bytes:3634606 (3.4 Mb)  TX bytes:21750172 (20.7 Mb)
          Interrupt:9 Base address:0x9c00
 
lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:5571169 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5571169 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:775583779 (739.6 Mb)  TX bytes:775583779 (739.6 Mb)
 
 
 
16.. Thought the configuration is done... you still cannot acccess the internet.. from a private machime with
192.168.0.3 (say) address.
 
17. this is becasue of IP_Tables configuration and ipchains configuration that I will describe in next mail.
 
 
 
Regards
Shashank