原 RHEL6網路配置

2021-09-08 16:00:03 字數 4417 閱讀 4368

一.非橋接模式:

配置:/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     inte***ces

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)

Rhel6斷網時開發環境配置

和銀行合作,對方環境要求是,斷網,rhel6 系統,ocr環境需要python,opencv,tensorflow,tesseract。解決方案 yum 代替 ubuntu 下的 apt,配置本地源 參考教程 參考教程 yum list yum list installed yum info sof...

fedora 6網路配置

linux 提供了絕大多數的網絡卡驅動 大多數情況下不需要安裝網絡卡驅動 直接配置網路引數如 ip,dns 等就行了 網絡卡驅動程式的存放位置 lib modules uname r kernel drivers net 其中uname r 命令可得核心版本號 1.檢視核心是否已支援網絡卡 dmes...

CentOS 6網路配置

常見的網路裝置lo 回環裝置 eth0 系統內第一塊乙太網卡 ppp0 系統內第乙個序列裝置 多數出現在使用adsl撥入internet時 centos 6 配置網絡卡時有4種配置方式,可以跟據自己情況選擇合適的一種 這裡以centos 6.2為例,網絡卡以eth0為例 一 圖形介面配置方式 開啟 ...