Accessing to some repository and website for sanctioned countries always is a big challenge for developers. I try to find the best and easiest way to proxy entire system in Ubuntu with Tor, privoxy and bridge.
I tried creating a network bridge through Virtual Machine Manager for KVM. Now my Ubuntu network connection depends on my Windows KVM being booted.
Since creating this bridge when Ubuntu is booted there is no network connectivity at all, no network icon at the top right corner of the screen, no web pages will load, and I am even unable to access any of my local servers and other computers on the network.
The process to get network connectivity back after a reboot is to open VMM, go to network connections and enable the bridge that I created (it's set to start on boot but it doesn't). However just enabling the bridge isn't enough, still nothing works. It's not until my Windows 10 VM is fully booted that suddenly I have full network connectivity again, and everything works fine.
I don’t know how that happened. But I need to get my Ubuntu networking set back to normal. Then I need to figure out how to properly bridge Ubuntu and KVM
I set up my first ubuntu server recently and I am struggeling with netplan.
As I need a Windows to run one service which isnt available on linux, I try to set up KVM.
The server has serveral static ips used for different services or docker containers running services, so my netplan config looks like this:
network:
version: 2
renderer: networkd
ethernets:
enp30s0:
dhcp4: no
addresses: [xxx.xxx.xxx.100/24, xxx.xxx.xxx.102/24, xxx.xxx.xxx.105/24, ...]
gateway4: xxx.xxx.xxx.1
nameservers:
addresses: [xxx.xxx.xxx.1]
Now it seems as I need to create a network bridge to make it available for the guest machine, but I was unable to find a solution to do so only for 1 adress.
Is there any way to achieve this, or am I making a conceptual mistake here?
Any help would be highly appreciated! Thank you.
Summary: how to configure the netplan on a host machine to create a bridge (with a static IP address) that would be used on guest virtual machine (shall be accessible from a local lan).
I am using Ubuntu 17.10, 32 bit. nplan 0.32~17.10.1.
I am trying to configure a linux virtual container that should be accessible from the local network.
But I am failing to configure a bridge on host machine with the nplan.
I have tried to follow the following guide with no luck:
https://discuss.linuxcontainers.org/t/static-ip-for-containers-with-local-lan-access/817
The guide configures a host system with two NICs. My host machine has a single interface.
I am still dealing with the nplan configuration on my host machine. My nplan config on host machine is the following:
network:
version: 2
renderer: networkd
ethernets:
ens32:
dhcp4: no
dhcp6: no
addresses: [10.0.0.247/24]
gateway4: 10.0.0.138
nameservers:
addresses: [10.0.0.138,8.8.8.8,8.8.4.4]
bridges:
br0:
interfaces: [ens32]
dhcp4: no
dhcp6: no
addresses: [10.0.0.248/24]
parameters:
stp: false
forward-delay: 0
after 'netplan apply' on host machine I can resolve google.com, but I can not ping:
ping google.com
PING google.com (172.217.22.174) 56(84) bytes of data.
From fileserver (10.0.0.247) icmp_seq=1 Destination Host Unreachable
ip a
1: lo ...
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
link/ether 00:01:2e:4c:4c:97 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.247/24 brd 10.0.0.255 scope global ens32
valid_lft forever preferred_lft forever
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ba:5f:c3:f0:a8:bd brd ff:ff:ff:ff:ff:ff
inet 10.0.0.248/24 brd 10.0.0.255 scope global br0
valid_lft forever preferred_lft forever
When I remove the complete section 'bridges:' from the nplan config I have to reboot the computer to get rid of the bridge (netplan apply is not enough - why?).
After the reboot, I can ping google.com.
Any help with the nplan configuration (on host and also on virtual guest) would be very welcome.
Thank you.
I wanted to use my desktop with a wired ethernet connection (eth0) to operate my "TP-LINK TL-WN722N" USB Wifi Adapter (wlan0) as a non-adhoc (infrastructure mode) access point for my Android to connect to.
After MUCH searching, I finally found a method (spread across many websites) that does most of what I need...
Dependencies:
hostapd
bridge-utils
I modified "/etc/network/interfaces"
sudo gedit /etc/network/interfaces
to contain:
# This file describes the network interfaces available on your system
# and how to activate them.
auto lo br0
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0 inet manual
# Bridge setup
# for dhcp address
iface br0 inet dhcp
bridge_ports eth0 wlan0
# for static ip
# iface br0 inet static
# bridge_ports eth0 wlan0
# adapt with your network settings
# address 192.168.1.250
# netmask 255.255.255.0
# network 192.168.1.0
# broadcast 192.168.1.255
# gateway 192.168.1.1
# dns-* options are implemented by the resolvconf package, if installed
# dns-nameservers 192.168.1.1
# dns-search localdomain
### Reference ###
# Creating a Wireless Access Point with Debian Linux « Agent Oss (October 31, 2011)
# https://agentoss.wordpress.com/2011/10/31/creating-a-wireless-access-point-with-debian-linux/
My "/etc/hostapd/hostapd.conf" (which I somehow managed to put together myself)
sudo gedit /etc/hostapd/hostapd.conf
contains:
### Guts ###
interface=wlan0
bridge=br0
driver=nl80211
### General ###
ssid=____________________
hw_mode=g
channel=1
### Security ###
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0 ## 0 visible # 1 hidden ##
wpa=2
wpa_passphrase=____________________
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
### Reference ###
## Created Tuesday, February 14, 2012 ## Ubuntu 11.10/12.04 ##
# Hostapd Linux Documentation Page
# http://linuxwireless.org/en/users/Documentation/hostapd
# Creating a Network Bridge on Ubuntu (January 16th, 2011)
# http://webserver.linuxportal.nl/?p=422
(I've edited out the security bits for this post)
All of that allows me to open up a Terminal and execute:
sudo hostapd -B /etc/hostapd/hostapd.conf
to have a functioning access point that my Android and all other WiFi devices can connect to.
Aside from sharing this method with others since info for this setup is so sparse; there are three problems that would be nice to fix:
- This configuration deactivates network manager and all of its functions. When you click it, it gives a "device not managed" message. (not essential, but a bit annoying to me)
- This method can struggle with IP addresses from time to time.
I must use a terminal to turn on Wifi. (Ok for me, but not family friendly).I figured out how to make a launcher using gksu and a simple script if anyone needs one...
- (Why can't network manager do this out-of-the-box??)
Thanks in advance! I hope all of this can help someone else; I've never written a tutorial before and know virtually nothing about networking...
Perhaps related to network bridge - without destroying network manager (among others).
Tested using Ubuntu 11.10, 12.04.