Skip to main content
deleted 169 characters in body
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152

Note: This has not been answered yet, but I have posted a lot of progress in the OP, so that only a small amount of additional help is required to finish it.

Note: This has not been answered yet, but I have posted a lot of progress in the OP, so that only a small amount of additional help is required to finish it.

added 1386 characters in body
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152

As per @garethTheRed's comments, I imagine that firewalld might alsotyped ip route in the web vm and got the following:

[root@localhost network-scripts]# ip route
default via 10.0.0.1 dev eth0  proto static  metric 100 
10.0.0.0/24 dev eth0  proto kernel  scope link  src 10.0.0.6  metric 100 
10.1.1.0/30 dev ens7  proto kernel  scope link  src 10.1.1.2 
10.1.1.2/31 dev ens7  proto kernel  scope link  src 10.1.1.2  metric 100 
169.254.0.0/16 dev ens7  scope link  metric 1003 
[root@localhost network-scripts]# 

I then typed ip route in data vm and got the following:

[root@localhost network-scripts]# ip route
default via 10.0.0.1 dev eth0  proto static  metric 100 
10.0.0.0/24 dev eth0  proto kernel  scope link  src 10.0.0.5  metric 100 
10.1.1.0/31 dev ens7  proto kernel  scope link  src 10.1.1.1  metric 100 
10.1.1.0/30 dev ens7  proto kernel  scope link  src 10.1.1.1 
169.254.0.0/16 dev ens7  scope link  metric 1003 
[root@localhost network-scripts]# 

Stripping the ifcfg-* file down to the 6 lines in the answer caused a failure when I tried systemctl restart network. I think it may be involveddue to the hardware or uuid arguments, but that is just a guess. When I restored the ifcfg-* files to include @garethTheRed's edits in addition to the extra arguments shown above, systemctl restart network then ran without error, but the pings failed.

I imagine that firewalld might also be involved.

As per @garethTheRed's comments, I typed ip route in the web vm and got the following:

[root@localhost network-scripts]# ip route
default via 10.0.0.1 dev eth0  proto static  metric 100 
10.0.0.0/24 dev eth0  proto kernel  scope link  src 10.0.0.6  metric 100 
10.1.1.0/30 dev ens7  proto kernel  scope link  src 10.1.1.2 
10.1.1.2/31 dev ens7  proto kernel  scope link  src 10.1.1.2  metric 100 
169.254.0.0/16 dev ens7  scope link  metric 1003 
[root@localhost network-scripts]# 

I then typed ip route in data vm and got the following:

[root@localhost network-scripts]# ip route
default via 10.0.0.1 dev eth0  proto static  metric 100 
10.0.0.0/24 dev eth0  proto kernel  scope link  src 10.0.0.5  metric 100 
10.1.1.0/31 dev ens7  proto kernel  scope link  src 10.1.1.1  metric 100 
10.1.1.0/30 dev ens7  proto kernel  scope link  src 10.1.1.1 
169.254.0.0/16 dev ens7  scope link  metric 1003 
[root@localhost network-scripts]# 

Stripping the ifcfg-* file down to the 6 lines in the answer caused a failure when I tried systemctl restart network. I think it may be due to the hardware or uuid arguments, but that is just a guess. When I restored the ifcfg-* files to include @garethTheRed's edits in addition to the extra arguments shown above, systemctl restart network then ran without error, but the pings failed.

removed more clutter
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152

Note that bridge networking already links the host OS to each of the guest OS'.

The local area network ip of webvm is 10.0.0.6 and the network ip of datavm is 10.0.0.5. The connection string from a typical web app hosted on webvm is:

You can see that localhost refers to webvm. How do I change the connection string to refer to datavm? I hesitate We apparently need to useset up a NEW, second bridge network with 10.1.1.x addresses, so that the connection string would become jdbc:mysql://10.01.01.51:3306/somedb?autoReconnect=true because I do not want data transactions traveling across the network?

Also note that bridge networking already links the host OS to each of the guest OS'. So I don't want to do anything to mess up the host/guest bridge. The code that was used on the HOST to set up bridge networking with the guests is:

//Before creating vms
# nmcli con show         (shows network connections before)
# nmcli con add type bridge ifname br0          (adds bridge networking)
# nmcli con show         (shows network connections after)

//after creating vms
# nmcli connection modify bridge-br0 ipv4.method manual ipv4.addresses host.ip.addr/24 ipv4.gateway router.ip.addr
# nmcli con down bridge-br0; nmcli con up bridge-br0 
# nmcli con up bridge-slave-eno1 
# ip link (on host, will show vm connections as vnetX)

# bcrtl addif br0 vnet3  (this adds the vm to the network so you can ping it from elsewhere on the network.  the vnet3 is a result from ip link that is a vm)

Now switch to another computer, open a terminal, and ssh [email protected] to connect to the virtual machine via ssh.

Whatever new bridge networking code we add must not conflict with the abovepre-existing bridge networking code that was already usednetwork.

In chat, @derobert suggested the following steps:

The network ip of webvm is 10.0.0.6 and the network ip of datavm is 10.0.0.5. The connection string from a typical web app hosted on webvm is:

You can see that localhost refers to webvm. How do I change the connection string to refer to datavm? I hesitate to use jdbc:mysql://10.0.0.5:3306/somedb?autoReconnect=true because I do not want data transactions traveling across the network?

Also note that bridge networking already links the host OS to each of the guest OS'. So I don't want to do anything to mess up the host/guest bridge. The code that was used on the HOST to set up bridge networking with the guests is:

//Before creating vms
# nmcli con show         (shows network connections before)
# nmcli con add type bridge ifname br0          (adds bridge networking)
# nmcli con show         (shows network connections after)

//after creating vms
# nmcli connection modify bridge-br0 ipv4.method manual ipv4.addresses host.ip.addr/24 ipv4.gateway router.ip.addr
# nmcli con down bridge-br0; nmcli con up bridge-br0 
# nmcli con up bridge-slave-eno1 
# ip link (on host, will show vm connections as vnetX)

# bcrtl addif br0 vnet3  (this adds the vm to the network so you can ping it from elsewhere on the network.  the vnet3 is a result from ip link that is a vm)

Now switch to another computer, open a terminal, and ssh [email protected] to connect to the virtual machine via ssh.

Whatever new bridge networking code we add must not conflict with the above bridge networking code that was already used.

In chat, @derobert suggested the following steps:

Note that bridge networking already links the host OS to each of the guest OS'.

The local area network ip of webvm is 10.0.0.6 and the network ip of datavm is 10.0.0.5. The connection string from a typical web app hosted on webvm is:

You can see that localhost refers to webvm. We apparently need to set up a NEW, second bridge network with 10.1.1.x addresses, so that the connection string would become jdbc:mysql://10.1.1.1:3306/somedb?autoReconnect=true.

Whatever new bridge networking code we add must not conflict with the pre-existing bridge network.

@derobert suggested the following steps:

deleted 431 characters in body
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
removed clutter
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
removed clutter
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
added 1055 characters in body
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
addred results of trying to set ip addresses
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
how do i add ip addresses to the interfaces?
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
added results of ongoing work towards solution.
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
updated with additional progress towards solution
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
Tweeted twitter.com/StackUnix/status/654384744734527488
corrected error
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
added 641 characters in body
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
added 1826 characters in body
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
clarified question and reduced clutter
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
added bridge networking code
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading
Source Link
CodeMed
  • 5.4k
  • 50
  • 111
  • 152
Loading