Scenario (Ubuntu Server 16.04):
A server is located via a static ip: eg 192.168.178.79. The servers networking is configured as a bridge:
ifconfig shows:
br0 Link encap:Ethernet HWaddr b0:5a:da:87:9a:ec
inet addr:192.168.178.79 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::b25a:daff:fe87:9aec/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1138 errors:0 dropped:0 overruns:0 frame:0
TX packets:1543 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:121101 (121.1 KB) TX bytes:3243595 (3.2 MB)
em1 Link encap:Ethernet HWaddr b0:5a:da:87:9a:ec
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1172 errors:0 dropped:0 overruns:0 frame:0
TX packets:2602 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:153356 (153.3 KB) TX bytes:3324020 (3.3 MB)
Interrupt:16
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:65536 Metric:1
RX packets:2734 errors:0 dropped:0 overruns:0 frame:0
TX packets:2734 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:1305517 (1.3 MB) TX bytes:1305517 (1.3 MB)
A virutal machine within this server is using a static ip 192.168.178.51 and its
ipconfig shows:
ens3 Link encap:Ethernet HWaddr 52:54:00:15:9f:c0
inet addr:192.168.178.51 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe15:9fc0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:181 errors:0 dropped:0 overruns:0 frame:0
TX packets:142 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:136824 (136.8 KB) TX bytes:15128 (15.1 KB)
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:65536 Metric:1
RX packets:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:11840 (11.8 KB) TX bytes:11840 (11.8 KB)
The server is currently running apache2 with two working websites on 80 and 443 ports. They are reachable because i opened the ports via the router.
First concern: I dont understand, why the server has "no" internet connection. Eg:
sudo apt update
Is not working and i am only able to ping the local network addresses. Whats wrong here?
Now i want to setup a new homepage using apache2 on my virtual machine, but if i set it up. It is not reachable, because i am not able to open the 80 and 443 port for 192.168.178.51 (the vm) on my router because it is already used by the server 192.168.178.79. I guess i have to redirect something at 192.168.178.79 so it gets forwarded to 192.168.178.51?
Any help is welcome! Thank you!