mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 13:22:36 +00:00 
			
		
		
		
	create the bridge with a script
This commit is contained in:
		@@ -35,14 +35,18 @@ Create a customized bridge on the Docker host
 | 
			
		||||
 | 
			
		||||
**Docker containers** connect to the Docker host network via a network bridge. To run xCAT in Docker, you should create a customized bridge according to the cluster network plan, instead of the default bridge "docker0".
 | 
			
		||||
 | 
			
		||||
As an example, create a bridge "br0" and attach the network interface "eth0" to it ::   
 | 
			
		||||
Since the commands to create the bridge will break the network connection on "eth0", you'd better create a script such as "mkbridge" to create the bridge instead of running the commands sequencially. As an example, create a bridge "br0" and attach the network interface "eth0" to it. ::   
 | 
			
		||||
 | 
			
		||||
    [root@dockerhost1 ~]# cat /tmp/mkbridge
 | 
			
		||||
    #!/bin/bash
 | 
			
		||||
    brctl addbr br0
 | 
			
		||||
    brctl setfd br0 0
 | 
			
		||||
    ip addr del dev eth0 10.5.106.1/24
 | 
			
		||||
    ip addr del dev eth0 10.5.106.5/24
 | 
			
		||||
    brctl addif br0 eth0
 | 
			
		||||
    ip link set br0 up
 | 
			
		||||
    ip addr add dev br0 10.5.106.1/24
 | 
			
		||||
    ip addr add dev br0 10.5.106.5/24
 | 
			
		||||
    [root@dockerhost1 ~]# chmod +x /tmp/mkbridge
 | 
			
		||||
    [root@dockerhost1 ~]# /tmp/mkbridge 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Pull the xCAT Docker image from DockerHub:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user