博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[原]RHEL6网络配置
阅读量:5764 次
发布时间:2019-06-18

本文共 3563 字,大约阅读时间需要 11 分钟。

一.非桥接模式:

配置:/etc/sysconfig/network-scripts/ifcfg-eth0,如下:

DEVICE="eth0"

HWADDR="11:11:11:11:11:11"
NM_CONTROLLED="yes"
ONBOOT="yes"
BOOTPROTO=static
IPADDR=192.168.77.103
NETMASK=255.255.255.0
GATEWAY=192.168.77.1

二.桥接模式:

1.配置/etc/sysconfig/network-scripts/ifcfg-eth0,如下:

DEVICE="eth0"

TYPE=ethernet
HWADDR="11:11:11:11:11:11"
NM_CONTROLLED="no"
ONBOOT="yes"
#BOOTPROTO=static
#IPADDR=192.168.77.103
#NETMASK=255.255.255.0
#GATEWAY=192.168.77.1
BRIDGE=br0

2.配置/etc/sysconfig/network-scripts/ifcfg-br0,如下:

DEVICE="br0"
TYPE=Bridge
BOOTPROTO=static
IPADDR=192.168.77.103
NETMASK=255.255.255.0
#NETWORK=192.168.1.0
GATEWAY=192.168.77.1
#HWADDR="11:11:11:11:11:11"
#NM_CONTROLLED="yes"
ONBOOT="yes"
NM_CONTROLLED=no

3.[可略]配置/etc/sysconfig/network-scripts/ifcfg-eth1,如下:

DEVICE="eth1"
HWADDR="78:2B:CB:65:25:EC"
NM_CONTROLLED="yes"
ONBOOT="yes"
BOOTPROTO=static
IPADDR=10.10.10.103
#netmask=255.255.255.0
#GATEWAY=10.10.10.1

4.修改/etc/sysctl.conf 文件,并增加如下:

net.bridge.bridge-nf-call-ip6tables = 0

net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
net.bridge.bridge-nf-filter-vlan-tagged=0
保存退出。

5.重启网络: /etc/init.d/network restart

三.查询验证:

1.brctl show:

bridge name     bridge id               STP enabled     interfaces

br0             8000.782bcb6525eb       no              eth0
                                                        vnet0
virbr0          8000.000000000000       yes

2.ifconfig查询结果类似,则表明br0桥接配置成功:

[root@compute3RHEL6 network-scripts]# ifconfig

br0       Link encap:Ethernet  HWaddr 11:11:11:11:11:11
          inet addr:192.168.77.103  Bcast:192.168.77.255  Mask:255.255.255.0
          inet6 addr: fe80::1111:1111:1111:1111/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14328578 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4650570 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4459176095 (4.1 GiB)  TX bytes:320844851 (305.9 MiB)
eth0      Link encap:Ethernet  HWaddr 11:11:11:11:11:11
          inet6 addr: fe80::7a2b:cbff:fe65:25eb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14338630 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4651391 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4718080971 (4.3 GiB)  TX bytes:362095405 (345.3 MiB)
          Interrupt:36 Memory:da000000-da012800
eth1      Link encap:Ethernet  HWaddr 78:2B:CB:65:25:EC
          inet6 addr: 1111::1111:1111:1111:25ec/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:32644 errors:0 dropped:0 overruns:0 frame:0
          TX packets:445 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2548629 (2.4 MiB)  TX bytes:41490 (40.5 KiB)
          Interrupt:48 Memory:dc000000-dc012800
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:1028 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1028 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1180221 (1.1 MiB)  TX bytes:1180221 (1.1 MiB)
virbr0    Link encap:Ethernet  HWaddr 11:11:11:11:11:11
          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:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:4276 (4.1 KiB)
vnet0     Link encap:Ethernet  HWaddr 11:11:11:11:11:11
          inet6 addr: 1111::1111:11:1111:1111/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:70 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2062 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:12016 (11.7 KiB)  TX bytes:178631 (174.4 KiB)

转载地址:http://ouwux.baihongyu.com/

你可能感兴趣的文章
带参数的函数装饰器
查看>>
HTML之禁止输入文本
查看>>
mysql报错问题解决MySQL server PID file could not be found!
查看>>
孕三十六周第五天
查看>>
P2158 [SDOI2008]仪仗队
查看>>
P1313 计算系数
查看>>
前端性能优化(七)
查看>>
C#程序访问PostgreSQL数据库
查看>>
Sql Jions 的简易理解
查看>>
WML处理---H_wml.php
查看>>
HDU 1018 Big Number 斯特林公式
查看>>
学习SAS_001_循环语句中读取数据文件
查看>>
VS2010出现FileTracker : error FTK1011编译错误的解决办法
查看>>
linux sed命令详解(转)
查看>>
linux系统中ls命令的用法
查看>>
TreeMap cannot be cast to java.lang.Comparable
查看>>
Java线程中断的本质深入理解(转)
查看>>
Linux下关于解决JavaSwing中文乱码的情况(转)
查看>>
GNU构建系统和AutoTools
查看>>
codeforces 797F Mice and Holes
查看>>