[root@instructor Desktop]# ifconfig -a
br0 Link encap:Ethernet HWaddr FE:C1:61:D1:15:61
inet addr:192.168.0.254 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::fcc1:61ff:fed1:1561/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:576 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:101175 (98.8 KiB)
br0:0 Link encap:Ethernet HWaddr FE:C1:61:D1:15:61
inet addr:192.168.1.254 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth4 Link encap:Ethernet HWaddr 00:0C:29:FB:BE:C9
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:18 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:171 errors:0 dropped:0 overruns:0 frame:0
TX packets:171 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:15472 (15.1 KiB) TX bytes:15472 (15.1 KiB)
virbr0 Link encap:Ethernet HWaddr AA:BC:AB:D0:1E:87
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:204 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:39222 (38.3 KiB)
[root@instructor Desktop]# service network stop
Shutting down interface br0: [ OK ]
Shutting down loopback interface: [ OK ]
[root@instructor Desktop]# ifdown br0
[root@instructor Desktop]# ifdown br0:0
批注 [陈1]: 网桥
批注 [陈2]: 启用的网卡
[root@instructor Desktop]# brctl delbr br0
[root@instructor Desktop]# cd /etc/sysconfig/network-scripts/
[root@instructor network-scripts]# cp ifcfg-eth0 ifcfg-eth4
[root@instructor network-scripts]# vi ifcfg-eth4
[root@instructor network-scripts]# cat ifcfg-eth4
DEVICE=eth4
BOOTPROTO=none
DNS1=192.168.1.1
HOSTNAME="instructor.example.com"
HWADDR=00:0c:29:fb:be:c9
IPADDR=192.168.1.27
GATEWAY=192.168.1.1
MTU=1500
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
将网卡该为VMnet0桥连
批注 [陈3]: 删除网桥
批注 [陈4]: 无eth4网卡,添加
批注 [陈5]: Eth4配置信息
[root@instructor network-scripts]# system-config-network
--------修改结果------
[root@instructor network-scripts]# ls
glsorig-ifcfg-eth0 ifdown ifdown-post ifup-aliases ifup-plip ifup-tunnel
ifcfg-br0 ifdown-bnep ifdown-ppp ifup-bnep ifup-plusb ifup-wireless
ifcfg-br0:0 ifdown-eth ifdown-routes ifup-eth ifup-post init.ipv6-global
ifcfg-eth0 ifdown-ippp ifdown-sit ifup-ippp ifup-ppp net.hotplug
ifcfg-eth4 ifdown-ipv6 ifdown-tunnel ifup-ipv6 ifup-routes network-functions
ifcfg-lo ifdown-isdn ifup ifup-isdn ifup-sit network-functions-ipv6
[root@instructor network-scripts]# rm ifcfg-br0
rm: remove regular file `ifcfg-br0'? y
[root@instructor network-scripts]# rm ifcfg-br0:0
rm: remove regular file `ifcfg-br0:0'? y
[root@instructor network-scripts]# service network restart
Shutting down interface eth4: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization.
[FAILED]
Bringing up interface eth4: [ OK ]
批注 [陈6]: 后选择Device configuration->eth4->修改
批注 [陈7]: 删除br0配置文件
[root@instructor network-scripts]# setup
[root@instructor network-scripts]# service network restart
Shutting down interface eth4: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization.
[FAILED]
Bringing up interface eth4: [ OK ]
[root@instructor network-scripts]# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=3.91 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=2.29 ms
^X^C
--- 192.168.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1993ms
rtt min/avg/max/mdev = 2.291/3.101/3.911/0.810 ms
[root@instructor network-scripts]# ping www.baidu.com
PING www.a.shifen.com (61.135.169.105) 56(84) bytes of data.
64 bytes from 61.135.169.105: icmp_seq=1 ttl=51 time=6.50 ms
64 bytes from 61.135.169.105: icmp_seq=2 ttl=51 time=7.02 ms
^C64 bytes from 61.135.169.105: icmp_seq=3 ttl=51 time=6.89 ms
64 bytes from 61.135.169.105: icmp_seq=4 ttl=51 time=11.4 ms
^X^C
--- www.a.shifen.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3979ms
rtt min/avg/max/mdev = 6.508/7.975/11.476/2.032 ms
-------------------------配置结束,验证
[root@instructor network-scripts]# cat /proc/net/dev
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 16256 182 0 0 0 0 0 0 16256 182 0 0 0 0 0 0
eth4: 273326 2270 0 0 0 0 0 0 552795 3039 0 0 0 0 0 0
virbr0: 0 0 0 0 0 0 0 0 481858 2450 0 0 0 0 0 0
sit0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Redhat6 删除网桥,切换网卡
原创
©著作权归作者所有:来自51CTO博客作者cswggod的原创作品,请联系作者获取转载授权,否则将追究法律责任
![](https://ucenter.51cto.com/images/noavatar_middle.gif)
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
centos 双网卡配置
双网卡
双网卡 -
redhat6访问控制
redhat6访问控制
访问控制 iptables redhat6 ssh