Issue:
You have a Redhat/Fedora Core workstation/server which needs to bind to more than one IP address with one ethernet card (eth0).
e.g. 192.168.0.22 and 192.168.0.23 where 192.168.0.22 is the primary already existing IP address and 192.168.0.23 is the new one to add.
Solution:
In Linux, we create a network alias:
1. Start the "Network" tool under System Tools in menu.
2. Under Devices tab, highlight the eth0 device and click the Edit button.
3a. Under the General tab, set the static ip address as follows:
ip address: 192.168.0.22
mask: 255.255.255.0
gateway: 192.168.0.1
3b. Click OK to return to devices tab.
4. With eth0 device highlighted, click the Copy icon.
5. With the new copied line highlighted, click the Edit icon.
6a. Under General tab, change the nickname field to something like "eth0:0".
6b. Still under the General tab, add the second IP address information as follows:
ip address: 192.168.0.22
mask: 255.255.255.0
gateway: 192.168.0.1
6c. Switch to the Hardware Device tab, check the box next to Device alias number to activate (check on). Adjust the alias number from 1 to 0.
6d. Click OK to return to devices tab.
7. Under File on window menu, click Save.
8. Close Network (Network Configuration) window.
9. Open Services and restart the Network service.
________________________________
Issue:
You have a Redhat 9 server which needs to bind to more than one IP address:
e.g. 192.168.0.2 and 192.168.0.3 where 192.168.0.2 is the primary already existing IP address and 192.168.0.3 is the new one to add.
Solution:
In Linux this is an alias. Editing the network configuratrion and adding an interface via the x-windows GUI should work, but in our case doesn't not always do so.
Another way is to run netconfig -d eth0:0 where eth0:0 is the virtual interface to add. In standard nomenclature, this is the 2nd IP address/1st additional alias.
e.g. see the following table
eth0 192.168.0.2
eth0:0 192.168.0.3
eth0:1 192.168.0.4
A crude DOS looking GUI will appear allowing you to set the second IP address, its network mask, its gateway, and its dns server.
e.g.
IP Address: 192.168.0.2
Mask: 255.255.255.0
Gateway: 192.168.0.1
DNS: 192.168.0.100
For Fedora, there is no netconfig utility. To set network:
- There are two ifcfg-eth0 files. Edit the one in /etc/sysconfig/network-scripts/ for Fedora.
- Change BOOTPROTO=dhcp to BOOTPROTO=static
- Add the following lines:
NETMASK=255.255.255.0
IPADDR=192.168.0.98
GATEWAY=192.168.0.1
# ifconfig -a
< confirm eth0 is part of output, and note the MAC address >
# pwd
/etc/sysconfig/network-scripts/
Note: Edit the ifcfg-eth0 file, confirm the MAC address is correct, and make the updates.
# vi ifcfg-eth0
...
BOOTPROTO=static
NETMASK=255.255.255.0
IPADDR=192.168.0.98
GATEWAY=192.168.0.1
<esc>:wq, to save.
# service network restart
<wait>
# ifconfig
< confirm the IP is now the correct IP >
previous page
|