Howto Red hat enterprise Linux 5 configure the network card
2013-07-29 14:10
579 查看
http://www.cyberciti.biz/faq/rhel-centos-fedoracore-linux-network-card-configuration/
April 10, 2007 · 88 comments·
LAST UPDATED October 21, 2007
in Networking,
RedHat and Friends,
Troubleshooting
Q. I’ve installed Red Hat enterprise Linux 5 and now added one more LAN card (NIC). How do I configure the network card from the command line? I can see 2nd my network card detected while booting the IBM server.
A. Red hat Linux provides following tools to make changes to Network configuration such as add new card, assign IP address, change DNS server etc.
[a] GUI tool (X Windows required) - system-config-network
Command line text based GUI tool (No X Windows required) - system-config-network
[c] Edit configuration files stored in [b]/etc/sysconfig/network-scripts/ directory.
Following instructions are compatible with
(1) Cent OS Linux
(2) Fedora Core Linux
(3) Red Hat Enterprise Linux (RHEL) 3/4/5
Note: If you are using Debian or Ubuntu Linux, please see
this configuration howto.
You will see Window as above. Now select your Ethernet card
(eth0 or eth1) and click on Edit button. You can now setup IP address, netmask, default gateway and other properties.
You can obtain IP address using DHCP or setup manually. Once IP address assigned, click on
Ok button to save the changes. You can activate card by clicking on
Activate button.
(click to enlarge image)
You will see text based GUI as above. Select your Ethernet card (eth0 or eth1) and hit [Enter] or [F12] special key.
(click to enlarge image)
You can obtain IP address using DHCP or setup manually. Once IP address assigned, click on
Ok button to save the changes
/etc/sysconfig/network-scripts/ directory. First change directory to /etc/sysconfig/network-scripts/:
You need to edit / create files as follows:
/etc/sysconfig/network-scripts/ifcfg-eth0 : First Ethernet card configuration file
/etc/sysconfig/network-scripts/ifcfg-eth1 : Second Ethernet card configuration file
To edit/create first NIC file, type command:
Append/modify as follows:
Save and close the file. Define default gateway (router IP) and hostname in /etc/sysconfig//network file:
Append/modify configuration as follows:
Save and close the file. Restart networking:
Make sure you have correct DNS server defined in /etc/resolv.conf file:
Setup DNS Server as follows:
Save and close the file. Now you can ping the gateway/other hosts:
Output:
You can also check for Internet connectivity with nslookup or host command:
Output:
You can also use host command:
Output:
Howto configure Ubuntu Linux/Debian Linux network configuration
Tweet
If you would like to be kept up to date with our posts, you can follow us on
Twitter,
Facebook,
Google+, or even by subscribing to our
RSS Feed.
Howto Red hat enterprise Linux 5 configure the network card
by nixCraft onApril 10, 2007 · 88 comments·
LAST UPDATED October 21, 2007
in Networking,
RedHat and Friends,
Troubleshooting
Q. I’ve installed Red Hat enterprise Linux 5 and now added one more LAN card (NIC). How do I configure the network card from the command line? I can see 2nd my network card detected while booting the IBM server.
A. Red hat Linux provides following tools to make changes to Network configuration such as add new card, assign IP address, change DNS server etc.
[a] GUI tool (X Windows required) - system-config-network
Command line text based GUI tool (No X Windows required) - system-config-network
[c] Edit configuration files stored in [b]/etc/sysconfig/network-scripts/ directory.
Following instructions are compatible with
(1) Cent OS Linux
(2) Fedora Core Linux
(3) Red Hat Enterprise Linux (RHEL) 3/4/5
Note: If you are using Debian or Ubuntu Linux, please see
this configuration howto.
Method # 1: GUI tool system-config-network
Type the following command at shell prompt (open x terminal):$ system-config-network &
You will see Window as above. Now select your Ethernet card
(eth0 or eth1) and click on Edit button. You can now setup IP address, netmask, default gateway and other properties.
You can obtain IP address using DHCP or setup manually. Once IP address assigned, click on
Ok button to save the changes. You can activate card by clicking on
Activate button.
Method # 2: Command line tool system-config-network-tui
If you don’t have X windows GUI installed type the following command at shell prompt:# system-config-network-tui &
(click to enlarge image)
You will see text based GUI as above. Select your Ethernet card (eth0 or eth1) and hit [Enter] or [F12] special key.
(click to enlarge image)
You can obtain IP address using DHCP or setup manually. Once IP address assigned, click on
Ok button to save the changes
Method #3: Edit configuration files stored in /etc/sysconfig/network-scripts/
You can configure network card by editing text files stored in/etc/sysconfig/network-scripts/ directory. First change directory to /etc/sysconfig/network-scripts/:
# cd /etc/sysconfig/network-scripts/
You need to edit / create files as follows:
/etc/sysconfig/network-scripts/ifcfg-eth0 : First Ethernet card configuration file
/etc/sysconfig/network-scripts/ifcfg-eth1 : Second Ethernet card configuration file
To edit/create first NIC file, type command:
# vi ifcfg-eth0
Append/modify as follows:
# Intel Corporation 82573E Gigabit Ethernet Controller (Copper) DEVICE=eth0 BOOTPROTO=static DHCPCLASS= HWADDR=00:30:48:56:A6:2E IPADDR=10.10.29.66 NETMASK=255.255.255.192 ONBOOT=yes
Save and close the file. Define default gateway (router IP) and hostname in /etc/sysconfig//network file:
# vi /etc/sysconfig/network
Append/modify configuration as follows:
NETWORKING=yes HOSTNAME=www1.nixcraft.in GATEWAY=10.10.29.65
Save and close the file. Restart networking:
# /etc/init.d/network restart
Make sure you have correct DNS server defined in /etc/resolv.conf file:
# vi /etc/resolv.conf
Setup DNS Server as follows:
nameserver 10.0.80.11 nameserver 10.0.80.12 nameserver 202.67.222.222
Save and close the file. Now you can ping the gateway/other hosts:
$ ping 10.0.80.12
Output:
PING 10.0.80.12 (10.0.80.12) 56(84) bytes of data. 64 bytes from 10.0.80.12: icmp_seq=1 ttl=251 time=0.972 ms 64 bytes from 10.0.80.12: icmp_seq=2 ttl=251 time=1.11 ms
You can also check for Internet connectivity with nslookup or host command:
$ nslookup cyberciti.biz
Output:
Server: 10.0.80.11 Address: 10.0.80.11#53 Non-authoritative answer: Name: cyberciti.biz Address: 75.126.43.232
You can also use host command:
$ host nixcraft.in
Output:
nixcraft.in has address 75.126.43.232 nixcraft.in mail is handled by 10 mail.nixcraft.in.
See also
=>Howto configure Ubuntu Linux/Debian Linux network configuration
Tweet
If you would like to be kept up to date with our posts, you can follow us on
Twitter,
Facebook,
Google+, or even by subscribing to our
RSS Feed.
相关文章推荐
- Howto Red hat enterprise Linux 5 configure the network card
- How to configure Virtual Network Computing (VNC) to work with Red Hat Enterprise Linux?
- How To Install And Configure Ganglia On Red Hat Enterprise Linux 5---YUM 安装篇
- How to configure a SMTP server in Red Hat Enterprise Linux
- How do I configure vncserver to start GNOME or KDE by default in Red Hat Enterprise Linux ?
- How do I configure the iscsi-initiator in Red Hat Enterprise Linux 5?
- How to use, monitor, and disable transparent hugepages in Red Hat Enterprise Linux 6
- How to rebuild RPM database on a Red Hat Enterprise Linux system?
- How to create Oracle ASM devices using device-mapper multipath devices in Red Hat Enterprise Linux 6
- How to mount Windows share on Red Hat Enterprise Linux system using CIFS
- How to configure the network for Linux
- How do I add more disk space to a virtual guest using LVM on Red Hat Enterprise Linux?
- How to configure the network under the Ubuntu
- Fedora Core 7 & Red Hat Enterprise Linux: The Complete Reference
- How do I add raw device mapping in Red Hat Enterprise Linux 5?
- Linux: How to Configure the DNS Server for 11gR2 SCAN (Doc ID 1107295.1)
- How to reset the root passwd if we forget the root password in red hat
- Red Hat Enterprise Linux 6.4 Set to Improve Microsoft Interoperability
- RedHat Enterprise Linux 6.4使用yum安装出现This system is not registered to Red Hat Subscription Management
- What is a "sosreport" and how do I create it in Red Hat Enterprise Linux 4.6 and later