How to configure static IP addresses in bridging mode for CentOS6.4 NICs in VMware

Source: Internet
Author: User
Tags dns2
1. disable network manager chkconfigNetworkManageroffserviceNetworkManagerstop2. create a virtual Nic cdetcsysconfignetwork-scriptscpifcfg-eth0ifcfg-br03 to bridge, edit ifcf

1. disable the network manager.

# chkconfig NetworkManager off# service  NetworkManager stop

2. create a virtual network card for bridging

# cd /etc/sysconfig/network-scripts # cp ifcfg-eth0 ifcfg-br0
3. edit ifcfg-br0
# vi ifcfg-br0 DEVICE="br0"TYPE="Bridge"ONBOOT="yes"BOOTPROTO=staticIPADDR=192.168.1.17PREFIX=24GATEWAY=192.168.1.1DNS1=202.106.46.151
DNS2=202.106.0.20DELAY=0 
Note: it is best to switch to the root account. Otherwise, the message "E45: 'readonly' option is set (add! To override)

4. edit ifcfg-eth0

# vi ifcfg-eth0 DEVICE="eth0"NM_CONTROLLED="yes"ONBOOT=yesTYPE=EthernetBRIDGE="br0"BOOTPROTO=noneIPADDR=192.168.1.17PREFIX=24GATEWAY=192.168.1.1DEFROUTE=yesIPV4_FAILURE_FATAL=yesIPV6INIT=noNAME="System eth0"UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03DNS1=202.106.46.151
DNS2=202.106.0.20
HWADDR=00:1E:67:07:EC:30 
IPADDR: IP address of the same network segment as your computer
GATEWAY: same as the default GATEWAY of your computer

5. restart the network.

# service network restart
6. the following error may be prompted::

Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization. [FAILED]

Solution:

First, open/etc/udev/rules. d/70-persistent-net.rules, as shown in the following example:

# vi /etc/udev/rules.d/70-persistent-net.rules# This file was automatically generated by the /lib/udev/write_net_rules# program, run by the persistent-net-generator.rules rules file.## You can modify it, as long as you keep each rule on a single# line, and change only the value of the NAME= key.# PCI device 0x1022:0x2000 (pcnet32)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8f:89:97", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"# PCI device 0x1022:0x2000 (pcnet32)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:50:bd:17", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
Record the mac address of the eth1 Nic: 00: 0c: 29: 50: bd: 17
Next, open the/etc/sysconfig/network-scripts/ifcfg-eth0

# Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Change DEVICE = "eth0" to DEVICE = "eth1 ",
Change HWADDR = "00: 0c: 29: 8f: 89: 97" to the above mac address HWADDR = "00: 0c: 29: 50: bd: 17"

Finally, restart the network.

# Service network restart
Or

#/Etc/init. d/network restart

Normal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.