Comments (7)
Perchè manca switch1[0].
Mi puoi fornire un output di ifconfig? Grazie
from kathara.
Ad ogni modo credo non sia proprio possibile creare eth1 senza eth0, quindi Katharà prova a farlo ma Linux non esegue.
from kathara.
Non ho inserito switch1[0] perché volevo collegarlo manualmente ad un eventuale controller Ryu.
Comunque eth1 viene creato anche senza eth0. Il problema si manifesta solo con eth2.
Questo è l'output di ifconfig
:
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 4e:23:1f:55:1d:4e txqueuelen 1000 (Ethernet)
RX packets 42 bytes 4123 (4.1 KB)
RX errors 0 dropped 1 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.18.0.2 netmask 255.255.0.0 broadcast 172.18.255.255
ether 02:42:ac:12:00:02 txqueuelen 0 (Ethernet)
RX packets 60 bytes 7266 (7.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.19.0.2 netmask 255.255.0.0 broadcast 172.19.255.255
ether 02:42:ac:13:00:02 txqueuelen 0 (Ethernet)
RX packets 61 bytes 7336 (7.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Questo invece è l'output di brctl show
:
18f72909-b4bf-45ac-aecc-440bae2711bf
Bridge "br0"
Port "br0"
Interface "br0"
type: internal
Port "eth1"
Interface "eth1"
Port "eth2"
Interface "eth2"
error: "could not open network device eth2 (No such device)"
ovs_version: "2.6.0"
from kathara.
Ciao, vi ho scritto per email ponendovi 2 dubbi.
Riporto il primo dei due dubbi qui, perché credo sia pertinente a questo stesso problema.
In uno switch avviato da questo file switch1.startup
:
ifconfig eth0 192.168.1.2/16 up
service openvswitch-switch start
ovs-vsctl add-br br0
ovs-vsctl add-port br0 eth1
ovs-vsctl add-port br0 eth2
ifconfig br0 up
viene eseguito solo il primo comando.
Una volta avviato il container, il servizio openvswitch-switch risulta ancora inattivo.
Nell'esempio che vi ho riportato stamattina le prime tre righe, tra cui l'avvio del servizio, venivano eseguite. In questo esempio invece si blocca prima. Inoltre, a differenza dell'esempio precedente, in questo caso ho configurato anche una porta eth0 con un proprio indirizzo.
from kathara.
Ciao Lorenzo,
qualche considerazione rispetto ai problemi che stai avendo.
Prima considerazione: il file di configurazione è scritto con un editor per Unix o per Windows? Purtroppo, se scritto con un editor per Windows, i terminatori di fine riga sono diversi da quelli di Unix e potrebbero creare problemi.
Seconda considerazione: ti consiglio di usare
/etc/init.d/openvswitch-switch start
invece di
service openvswitch-switch start
Terza considerazione: stai mettendo nel bridge br0 due interfacce (eth1 ed eth2) che non sono state create (almeno stando al file di configurazione che hai postato) e questo fa "arrabbiare" ovs-vsctl
:)
Quarta considerazione: tipicamente non c'è bisogno di interagire direttamente con i linux bridge (ifconfig br0 up
): a questo ci pensa la suite ovs-vsctl
.
Facci sapere come va con questi accorgimenti.
Ciao,
Gabriele
from kathara.
Grazie @glospoto,
Uso mousepad o visual studio code (come capita) su XUbuntu.
Da quando ho reinstallato katharà (dopo che @Kidel ha aggiunto il package bridge-utils) non sto più avendo alcun problema 🎈 (ma ancora devo provare a lanciare Ryu).
Nessun problema nemmeno a lanciare ovs con service .. start
👍 .
Comunque, per curiosità, le interfacce eth1 e eth2 non sono create automaticamente all'avvio nel caso in cui siano state indicate nel file lab.conf
?
from kathara.
L'algoritmo con cui sono create le interfacce è il seguente:
- viene parsato il lab.conf
- vengono stabiliti i link da creare (A, B, C...).
- Vengono associati i link alle macchine, ordinando per numero di interfaccia.
- Vengono creati i comandi docker e docker network per collegare le varie macchine in base ai link ed al loro ordine.
Questo non ci dà controllo sul numero effettivo dell'interfaccia, ma solo sul loro ordinamento.
Per avere una eth0 ti consiglio di collegarla ad un link a caso e poi modificarla da .startup
In alternativa puoi usare (nel lab.conf) switch1[bridged]=true
che crea un lin connesso ad internet tramite l'host.
Questa opzione viene però utilizzata dopo la creazione dei link normali, quindi anche se metti
switch1[bridged]=true
switch1[1]=A
switch1[2]=B
Avrai comunque eth0 su A, eth1 su B ed eth2 su bridge.
I termine riga di Windows poi li abbiamo corretti in modo forzato lato codice. Non dovrebbero dare problemi.
from kathara.
Related Issues (20)
- Wait `.shutdown` commands
- Add lab hash to Docker networks names
- Add `copy_directory_from_path` method to FilesystemMixin
- Kubernetes startup watch may never terminate if there is a Pod error
- Allow space in `sysctl` and `env` metas
- Add the possibility to specify a custom name for network scenario configuration file from the Python API
- Add `gnome-terminal` as terminal emulator
- "RTNETLINK answers: Operation not supported" when running traffic-control labs in MacOS HOT 4
- `tc` does not work on Windows hosts (WSL 2) HOT 1
- Use `rich` to render progress bars and add UI progress for Docker image pull
- Enable using `amd64` images on macOS using Rosetta
- UI Improvements using `rich`
- Multipath support not enabled in WSL
- API Improvements
- Bug using Kathara.get_instance().exec() with Kubernetes and stream=True with Kathara 3.7.3 HOT 5
- Not all Pods are Terminating with Kubernetes and Kathara 3.7.3 HOT 8
- Container Creation failed, rp_filter not found HOT 1
- Private registry support on Megalos HOT 1
- Can't undeploy link on running lab using Kathara.get_instance().undeploy_link() with the python api HOT 2
- Unable to add link to deployed lab HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kathara.