當前位置:首頁 » 幣種行情 » ifaceeth1inetmanual

ifaceeth1inetmanual

發布時間: 2022-08-06 08:36:40

① iface eth0 inet manual與iface eth0 inet static有什麼區別

這樣給你解釋你看看
eth0上IP為自動獲取
eth1上為手工設置(又是VPC自己要求的)
配置過程:
1、打開Ubuntu的/etc/network/interfaces文件
。默認內容如下:
auto
lo
iface
lo
inet
loopback
2、eth0為自動獲取IP,所以不需要配置了。插入要手工設置IP的eth1的IP信息,編輯後內容如下,前面auto
eth1,讓網卡開機自動掛載.:
auto
lo
iface
lo
inet
loopback
auto
eth1
iface
eth1
inet
static
address
192.168.0.101
netmask
255.255.255.0
network
192.168.0.0
broadcask
192.168.0.255
gateway
192.168.0.2
3、編寫完畢保存,然後打開終端運行如下命令,重新啟動網卡即可:
$
/etc/init.d/networking
restart
也可以重啟網卡讓新配置生效,優點是不影響其他網路介面:
$
sudo
ifdown
eth0
$
sudo
ifup
eth04、如果以DHCP方式配置網卡,則改為:
auto
eth0
iface
eth0
inet
dhcp
也可以在命令行下直接輸入下面的命令來獲取地址
sudo
dhclient
eth0
5、配置DNS伺服器的地址,最多可以使用3個DNS伺服器
$
sudo
vi
/etc/resolv.conf
nameserver
202.96.134.133
nameserver
202.96.128.68
nameserver
202.96.128.166
對"resolv.conf"的修改是即時生效的。可以使用nslookup命令進行DNS伺服器查詢,以驗證"resolv.conf"配置文件。
如何查看DNS
$
less
/etc/resolv.conf

② LINUX 配置雙公網IP地址,雙網卡,雙網關,要求2個IP都能PING通,怎麼配置

以 ubuntu 為例

sudo vi /etc/network/interfaces

auto eth0
iface eth0 inet static
address 192.168.0.101
netmask 255.255.255.0
gateway 192.168.0.1
auto eth1
iface eth1 inet static
address 10.10.120.100
netmask 255.255.255.0
gateway 10.10.120.1

③ 如何在ubuntu中搭建網橋

網橋工具的安裝:
默認Ubuntu是沒有網橋設置工具(brctl)的。你需要安裝bridge-utils,這里在我的pc2上:
SYSHUNTER-UBUNTU# apt-get install bridge-utils

配置網橋:
先創建一個網橋介面:
SYSHUNTER-UBUNTU# brctl addbr br0

將兩塊已有的網卡添加到網橋:
SYSHUNTER-UBUNTU# brctl addif br0 eth0
SYSHUNTER-UBUNTU# brctl addif br0 eth1

將兩塊網卡IP設置為0,它們已經不再需要了:
SYSHUNTER-UBUNTU# ifconfig eth0 0.0.0.0
SYSHUNTER-UBUNTU# ifconfig eth1 0.0.0.0

給新網橋設置一個IP:
SYSHUNTER-UBUNTU# ifconfig br0 192.168.1.10

結束語
經過上面安裝網橋工具,配置網橋,簡單幾步。現在pc1、pc2、lpt1已經在同一個區域網了,pc1、pc2、lpt1可以各自單獨撥號並相互共享訪問資源了。

④ 如何在utuntu下安裝mininet

Mininet教程

摘要:
這里給出了Mininet在ubuntu 12.04 KVM (qemu 1.0)的環境下測試

提前准備:宿主機ubuntu + 虛擬機KVM(官方給出的鏡像是vmdk vmware格式,教程中給出了vmdk到KVM鏡像qcow2裝換)
操作系統:ubuntu server amd64

安裝完成後設置宿主機網路為
ubuntu@node2:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.12
gateway 192.168.1.1
netmask 255.255.255.0

auto eth1
iface eth1 inet manual
auto br0
iface br0 inet static
address 192.168.1.18
gateway 192.168.1.1
netmask 255.255.255.0
bridge_ports eth1
bridge_stp on
bridge_maxwait 0

重啟網路服務,出現 br0網橋,這里假設有雙網卡。單網卡也可以見後文。
然後安裝 KVM
apt-get install -y kvm libvirt-bin
添加用戶到libvirtd組
useradd $USER libvirtd

virsh net-destroy virtbr0 && virsh net-undefine virbr0
然後重啟libvirt-bin
service libvirt-bin restart

對於單網卡使用KVM橋接方式的的用戶

brctl addbr br0
ifup br0
ifconfig br0 promisc
ifconfig br0 192.168.1.100 netmask 255.55.255.0 dev br0

就可以使用KVM橋接方式網橋br0

下載 mininet vmware鏡像

wget https://github.com/downloads/mininet/mininet/mininet-2.0.0-113012-amd64-ovf.zip

轉化鏡像 vmware 格式到 kvm支持的格式

如果使用的是vmware workstation 略過

使用KVM 並且 qemu-img 版本1.0 報錯

qemu-img convert -O qcow2 mininet-vm-disk1.vmdk mininet-vm-disk1.qcow2
報錯
ubuntu@node2:~/vmimg/mininet-ovf$ qemu-img convert -O qcow2 mininet-vm-disk1.vmdk mininet-vm-disk1.qcow2
qemu-img: error while reading sector 131072: Invalid argument
ubuntu@node2:~/vmimg/mininet-ovf$ qemu-img convert -f vmdk -O qcow2 mininet-vm-disk1.vmdk mininet-vm-disk1.qcow2
qemu-img: error while reading sector 131072: Invalid argument
ubuntu@node2:~/vmimg/mininet-ovf$

conversion of a VMDK image with qemu-img failed with 「error while reading sector 131072: Invalid argument」解決辦法http://serverfault.com/questions/429478/conversion-of-a-vmdk-image-with-qemu-img-failed-with-error-while-reading-sector
原因是qemu的版本太低需要大於1. x

cd /tmp
apt-get install apt-get install libglib2.0-dev
wget http://wiki.qemu.org/download/qemu-1.2.0.tar.bz2
tar xf qemu-1.2.0.tar.bz2
cd qemu-1.2.0 && ./configure && make -j16 (時間較長)

在/etc/libvirt/qemu/下創建mininet.xml(xml文件格式定義KVM鏡像配置具體google "qemu syntax")
sudo cat mininet.xml
[sudo] password for ubuntu:
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
virsh edit mininet
or other application using the libvirt API.
-->
<domain type='kvm'>
<name>mininet</name>
<uuid>3245e642-05dc-bd23-6d0e-e7582dc00660</uuid>
<memory>4194304</memory>
<currentMemory>4194304</currentMemory>
<vcpu cpuset='1,3,5,7,9,11,13,15'>4</vcpu>
<os>
<type arch='x86_64' machine='pc-1.0'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<cpu match='exact'>
<model>Westmere</model>
<vendor>Intel</vendor>
<feature policy='require' name='tm2'/>
<feature policy='require' name='est'/>
<feature policy='require' name='vmx'/>
<feature policy='require' name='ds'/>
<feature policy='require' name='ss'/>
<feature policy='require' name='vme'/>
<feature policy='require' name='rdtscp'/>
<feature policy='require' name='ht'/>
<feature policy='require' name='dca'/>
<feature policy='require' name='pbe'/>
<feature policy='require' name='tm'/>
<feature policy='require' name='pdpe1gb'/>
<feature policy='require' name='ds_cpl'/>
<feature policy='require' name='xtpr'/>
<feature policy='require' name='acpi'/>
<feature policy='require' name='monitor'/>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/mininet-vm-disk1.qcow2'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>
<interface type='bridge'>
<mac address='52:54:00:31:05:76'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</memballoon>
</devices>
</domain>
virsh create /etc/libvirt/qemu/mininet.xml

virsh consloe mininet
使用mininet:mininet

登陸修改
sudo ifconfig eth0 192.168.1.19 netmask 255.255.255.0 up
sudo route add default gw 192.168.1.1
sudo echo "nameserver 61.139.2.69" > /etc/resolv.conf
sudo echo "nameserver 61.139.2.69" > /etc/resolvconf/resolv.conf.d/base
ssh [email protected]
賬戶 mininet
密碼 mininet
配置靜態IP
root@mininet-vm:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.19
gateway 192.168.1.1
netmask 255.255.255.0
root@mininet-vm:~#

⑤ ubuntu 如何設置聯網

配置 ADSL 撥號上網 (不需撥號就跳過)

1.打開應用程序菜單,依次選擇附件 - 終端。

2.在彈出終端窗口後,輸sudo pppoeconf,輸入完成後回車。

3.然後會提示您輸入當前Ubuntu管理員用戶的密碼,輸入完成後回車。

詢問你的網路設備,一般選擇是,進行檢測,然後一直選擇是。

4.之後會提示您輸入您的ADSL用戶名(也就是帳號)和密碼,在輸入帳號時把原來的user刪掉,其它的除密碼之外的問題全部回答「是」(Yes)就可以了.

5.最後會提示您是否開機自動撥號,選擇Y的話,默認開機會沒有任何提示的情況下撥號,直接可以上網。如果選擇N的話,需要撥號時請手工進入終端輸入pon dsl-provider撥號命令進行手動撥號。
6. 在終端輸入
sudo gedit /etc/ppp/options
將 彈出的文檔中的 lcp-echo-failure 4 改為 lcp-echo-failure 40 這是因為Ubutnu默認的設置有個很明顯的缺陷,lcp-echo-failure次數被設為4,而lcp-echo-interval設為30秒。也 就是說,如果120秒鍾之內,ADSL伺服器沒有給回echo-reply信號,Ubuntu便會認為網路已經出了問題,馬上中斷重聯,搞得人非常不爽。
如 果你用XP撥號上ADSL是正常的,而在Ubuntu撥號上ADSL,卻是不停斷線,有可能是DHCP問題。這個問題,可能是你的MODEM自動給你 的, 某些MODEM是能自動撥號上去呢,比如我的MODEM大亞DB102-C 。你可以在瀏覽器輸入:192.168.1.1去檢測你的MODEM是否帶路由功能,能自動撥號,如果輸入後會有一個界面彈出,叫你輸入用戶名同密碼的 話,這就說明你的MODEM是帶路由功能的,當然你可以直接上網查你MODEM的型號和功能。如果是的這樣話,你可以進入你MODEM關閉它自己的 DHCP功能(如何進入你的MODEM關閉它的DHCP,請根據你的MODEM型號上網查詢),關了DHCP之後,我在Ubuntu下ADSL的撥號就沒 有短過線了,還有關了MODEM的DHCP功能後,你進入XP用ADSL撥號會好慢,所以你要把本地連接按下圖設置一下,這樣就OK。

Ubutnu官方論壇(forum.ubuntu.org.cn)上有個方法是:給你的eth設置一個固定IP,比如10.0.0.1或者192.168.0.1就可以了。還有如果你的MODEM可以撥號上網,你可以在Ubuntu就不用設PPPOE ,只需要設一下你的網卡,並將網關指向它就OK了。

讓 網路重新連接斷網命令是poff 如果ADSL撥號還是有問題的話,大家可以到Ubutnu論壇使用搜索功能查找解決辦法,又或者可以到Ubuntu WIKI
其它常用網路配置
圖形界面有時候配置網路不能生效,可以用命令行配置
IP命令行配置如下
sudo gedit /etc/network/interfaces
DHCP
DHCP配置如下(假設通過eth1上網)
# The primary network interface - use DHCP to find our address
auto eth1
iface eth1 inet dhcp //指定為dhcp
然後重啟
sudo /etc/init.d/networking restart
Static IP
靜態IP地址配置如下(假設通過eth1上網)
# The primary network interface
auto eth1
iface eth1 inet static //指定為static
address 192.168.3.90 //IP地址
gateway 192.168.3.1 //網關
netmask 255.255.255.0 //子網掩碼
同樣需要重啟
sudo /etc/init.d/networking restart
DNS
如果有必要,配置DNS
sudo gedit /etc/resolv.conf
nameserver 192.168.3.2

⑥ openstack配置永久網卡文件

最開始接觸Openstack,這塊是比較頭疼的,不同的文檔,設置都會有所差異,並且都能工作,到底哪個是正確的呢?恐怕很難有定論,這里總結一下,那天發到郵件列表裡請教.
下面這幾個設置,最終的結果,就是有一塊網卡變成bridge,我理解bridge,就是一個交換機, 虛擬機在上面可以進行互相的通訊.
下面假設 fix IP 採用192.168.100.0/24
一:單網卡
經常有朋友問,如果是單網卡,如何設置(https://blog.hpcloud.com/road-essex-part-4-openstack%E2%84%A2-nova-and-horizon)
在nova.conf 文件里
public_interface=eth0
flat_interface=eth0
flat_network_bridge=br100

由於是單塊網卡,這里就比較特別。
/etc/network/interface
auto br100
iface br100 inet static
address 192.168.100.1
netmask 255.255.255.0
bridge_stp off
bridge_fd 0

二:雙網卡
雙網卡,理解起來比較容易。
在nova.conf 文件里
public_interface=eth0
flat_interface=eth1
flat_network_bridge=br100

這里設置的含義就是eth1是一個bridge。
eth0的設置,就和普通網卡設置一樣,可以設置靜態IP,也是可以dhcp獲得。eth1的設置,我至少看到過3種設置
1:把網卡設置成混雜模式
這個很多文檔都是這樣設置,包括大名鼎鼎的培訓機構http://www.mirantis.com/blog/openstack-networking-single-host-flatdhcpmanager/
也是這樣推薦。另外Puppet的安裝openstack文檔,也是這樣推薦設置
iface eth1 inet manual
up ifconfig $IFACE 0.0.0.0 up
up ifconfig $IFACE promisc

2:不設置任何IP
這是我一直使用的設置,這個是https://github.com/managedit/openstack-setup
這位朋友,應該也是參與Openstack的開發者,以前維護Diablo 的deb包的更新
auto eth1
iface eth1 inet manual
up ifconfig eth1 up

3:設置IP
採用fix IP的網段,例如fix IP是:192.168.100.0/24, 前面10個IP地址,留給伺服器使用。那麼我們就可以給eth1設置IP。
http://www.hastexo.com/resources/docs/installing-openstack-essex-4-ubuntu-1204-precise-pangolin/step-1-prepare-your-system
在nova.conf 有一個參數
flat_network_dhcp_start=192.168.100.11

前面保留的IP,就可以用來設置eth1的IP, 啟動nova-network後,這個IP,就會變成所有虛擬機的網關. 如果你是採用mutilhost的設計.

ref:http://www.chenshake.com/openstack-settings-on-the-network-card/

⑦ ubuntu16.04 怎麼安裝 devstack

虛擬機網路配置

# The primary network interface vmnet 1 nat type
auto eth0
iface eth0 inet static
address 192.168.30.80
netmask 255.255.255.0
network 192.168.30.0
broadcast 192.168.30.255
gateway 192.168.30.2
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 114.114.114.114

# vmnet 2 nat type openstack 內部網路
auto eth2
iface eth2 inet manual
up ip link set dev $IFACE up
down ip link set dev $IFACE down

#vmnet 3 host only type openstack 外網
auto eth1
iface eth1 inet static
address 192.168.40.80
netmask 255.255.255.0

⑧ ubuntu不能用路由器上網

gateway 113.57.46.251 這個是路由器撥號的時候ips分配的網關
網關錯了
你如果通過路由器上網應該是 192.168.1.1

⑨ 關於Linux系統下設置雙網卡雙IP的問題!

ubuntu雙網卡雙IP.不同網關.不同子網.如何同時ping通兩塊網卡的解決方法,
伺服器環境如下:、
系統:Ubuntu 9.04 X64 server
電信IP(TEL):114.80.0.4 netmask 255.255.255.128 gateway 114.80.0.3
聯通IP(CNC):112.65.0.2 netmask 255.255.255.0 gateway 112.65.0.1
1.配置網卡信息
# vi /etc/network/interfaces
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 114.80.0.4
netmask 255.255.255.128
gateway 114.80.0.3
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 202.96.209.133
auto eth1
iface eth1 inet static
address 112.65.0.2
netmask 255.255.255.0
保存配置信息並重新啟動網卡
# /etc/init.d/networking restart
2.增加2個路由表分別是電信:tel 聯通:cnc
# vi /etc/iproute2/rt_tables
252 tel
251 cnc
保存並推出
3.增加路由規則
# ip route flush table tel
# ip route add default via 114.80.0.3 dev eth0 src 114.80.0.4 table tel
# ip ruleadd from 114.80.0.4 table tel
此處是設置電信的網關,並可實現讓電信的資源訪問只從eth0網卡出去
# ip route flush table cnc
# ip route add default via 112.65.0.1 dev eth1 src 112.65.0.2 table cnc
# ip rule add from 112.65.0.2 table cnc
此處是設置聯通的網關,並可實現讓聯通的資源訪問只從eth1網卡出去
4.配置networking啟動腳本文件 在結尾exit 0之前增加如下內容
# vi /etc/init.d/networking
ip route flush table tel
ip route add default via 114.80.0.3 dev eth0 src 114.80.0.4 table tel
ip rule add from 114.80.0.4 table tel
ip route flush table cnc
ip route add default via 112.65.0.1 dev eth1 src 112.65.0.2 table cnc
ip rule add from 112.65.0.2 table cnc
exit 0
5,退出並重啟網路
# /etc/init.d/networking restart
此時再測試機器網路情況,就會發現電信和聯通的地址都可以正常訪問了。此方法還可以實現讓從電信IP過來的請求按照電信路由返回,從網通IP過來的請求從網通路由返回。
補充:網上有些大神說如果伺服器重啟,或者網路服務重啟,上述的路由規則就失效了,所以你需要把上面這段命令寫入系統啟動腳本和網路啟動腳本
如果是ubuntu/debian,系統啟動腳本是/etc/rc.local
如果是RedHat/CentOS,系統啟動腳本是/etc/rc.d/rc.local
如果是ubuntu/debian,網路啟動腳本是/etc/init.d/networking
如果是RedHat/centos,網路啟動腳本是/etc/rc.d/init.d/network

熱點內容
用數字貨幣 發布:2024-05-06 02:47:48 瀏覽:983
eth怎麼和微軟合作 發布:2024-05-06 01:47:11 瀏覽:226
eth205縫線 發布:2024-05-06 01:40:12 瀏覽:73
區塊鏈可以買東西嗎 發布:2024-05-06 01:31:19 瀏覽:106
區塊鏈中國產品 發布:2024-05-06 00:52:57 瀏覽:195
比特幣種類太多了 發布:2024-05-06 00:33:16 瀏覽:249
hcash錢包如何挖礦 發布:2024-05-05 23:43:15 瀏覽:869
比特幣去哪裡挖礦 發布:2024-05-05 23:27:47 瀏覽:28
樂高無限挖礦工具 發布:2024-05-05 22:56:08 瀏覽:46
區塊鏈沒有中介商 發布:2024-05-05 22:42:20 瀏覽:310