setup xen on two phisical interfaces - interface

does anybody know how to setup XEN to use 2 interfaces? I have a subnet of local IPs on eth0 and subnet of external IPs on eth1. I want containers to be as on a dom0: eth0 and eth1 routed respectivly.
Thanks in advance

I'm currently using two NIC interfaces with Xenserver 6.2. I created them using XenCenter, I'm doing exactly what you're asking, using eth0 on all VMS for local connections and eth1 for internet.
How to do it.
If you have the pool created you need to go to the Networking tab, there you can add a network using the "Add Network" button and then follow the wizard.
If you have any more questions, there is a guide from Citrix. http://support.citrix.com/servlet/KbServlet/download/34969-102-704897/reference.pdf
Good luck.

I found solution by myself. I'll discribe it in case of someone need it
So far I had eth0 interface and br0 configured.
On dom0 I add additinal bridge. I call it br1
addbr addbr br1
Then I bind it to physical interface eth1
addif br1 eth1
Next, I am on Debaian, I configure /etc/network as follows
# The loopback network interface
auto lo
iface lo inet loopback
The primary network interface
auto br0
iface br0 inet static
address 172.16.15.240
netmask 255.255.255.0
network 172.16.15.0
gateway 172.16.15.1
broadcast 172.16.15.255
bridge_ports eth0
bridge_stp on
bridge_maxwait 0
bridge_fd 0
auto br1
iface br1 inet static
address 91.135.xxx.xxx
netmask 255.255.255.240
network 91.135.xxx.xxx
broadcast 91.135.xxx.xxx
gateway 91.135.xxx.xxx
bridge_ports eth1
bridge_stp on
bridge_maxwait 0
bridge_fd 0
dns-nameservers 8.8.8.8
Then in config file for container add virtual interface as follows
vif = [ 'ip=172.16.15.243 ,mac=00:16:3E:18:AF:C3,bridge=br0',
'ip=91.135.xxx.xxx ,mac=00:16:3E:DD:2D:00,bridge=br1'
]
That's it. After reboot both dom0 and domN, you will have container connected to phisical interfaces

Related

Raspberry Pi as WLAN hotspot and static IP on LAN

I have a Raspberry Pi 3B with Raspberry Pi OS lite and I would like to use the Pi as WLAN hotspot and server with a static IP (169.254.1.100) on eth0.
Therefore, I have installed dnsmasq and hostapd and edited following files:
I edited /etc/dnsmasq.conf:
# DHCP-Server aktiv für WLAN-Interface
interface=wlan0
# DHCP-Server nicht aktiv für bestehendes Netzwerk
no-dhcp-interface=eth0
# IPv4-Adressbereich und Lease-Time
dhcp-range=192.168.1.100,192.168.1.200,255.255.255.0,24h
# DNS
dhcp-option=option:dns-server,192.168.1.1
I added to /etc/dhcpcd.conf
interface wlan0
static ip_address=192.168.1.1/24
I edited /etc/hostapd/hostapd.conf:
interface=wlan0
ssid=PI_WLAN
channel=1
hw_mode=g
ieee80211n=1
ieee80211d=1
country_code=AT
wmm_enabled=1
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=somePassword
I am starting WLAN with
> sudo hostapd -dd /etc/hostapd/hostapd.conf
The WLAN is only created if the eth0 is not static, but when the IP is static DHCP fails to start and WLAN does not work.
How can I enable DHCP for WLAN0 even when DHCP is disabled for eth0?
Kind regards,
Wolfgang
It's not totally clear to me, but.. What I have with my pi is a wlan hotspot and a static ip address on ethernet interface. Is that what you want ?
In this case I simply edit /etc/dhcpcd.conf adding:
interface eth0
static ip_address=192.168.0.4/24
static routers=192.168.0.254
static domain_name_servers=192.168.0.254 8.8.8.8
interface wlan0
static ip_address=192.168.4.1/24
nohook wpa_supplicant
Then I installed hostapd and this is my hostapd.conf
country_code=IT
interface=wlan0
ssid=myssd
hw_mode=g
channel=7
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
I have my dnsmasq.conf like this (but honestly I don't remember to have touched it, maybe it's not necessary or done automatically..)
interface=wlan0 # Listening interface
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h
# Pool of IP addresses served via DHCP
domain=wlan # Local wireless DNS domain
address=/gw.wlan/192.168.4.1
# Alias for this router
I have my wlan hotspot with defined ssid which assign me a dymic ip address and raspberry is on a different LAN with a static IP.
Thank you rok for your answer, but I am failing to configure a static IP with dhcpcd.conf even if I use the predefined values in the file 🙁
Previously I defined the static IP with /etc/network/interfaces file:
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto eth0
iface eth0 inet static
address 169.254.1.100
netmask 255.255.255.0
gateway 169.254.1.1
Does it make a difference if the static IP is defined with dhcpcd.conf or with interfaces file? And how has dhcpcd.conf look like to have the same behaviour?
Kind regards,
Wolfgang

How to forward packets between VLANs on Open vSwitch router?

I'm trying to configure an OVS router. I want to achieve that, by adding flows on the OVS router, the devices connected with switch ports (port 2-5) can access to the internet, if the internet cable is inserted into the WAN port (port 1).
My VLAN configuration in file /etc/config/network of the OVS router is:
eth1.1: 0t, 2
eth1.2: 0t, 3
eth1.3: 0t, 4
eth1.4: 0t, 5
eth1.5: 1, 6
The output of ovs-vsctl show is:
root#OpenWrt:~# ovs-vsctl show
84d9ab2f-a3e6-46e3-874f-156ef975d673
Bridge "br0"
Controller "tcp:<an IP address>"
is_connected: true
fail_mode: standalone
Port "eth1.4"
Interface "eth1.4"
Port "eth1.2"
Interface "eth1.2"
Port "eth1.1"
Interface "eth1.1"
Port "br0"
Interface "br0"
type: internal
Port "eth1.3"
Interface "eth1.3"
The truncated output of ifconfig is:
br0: 192.168.3.1
eth0: 192.168.0.105 (There is another home router)
eth1, eth1.1-1.4
As the subnet provides IP prefix of 192.168.3.* and the router itself is assigned IP of 192.168.0., I wonder if it's helpful to add a flow to forward packets from 192.168.3. to 192.168.0.104.
So is it correct if I suppose, a machine with IP 192.168.3.10, for example, it wants to make query to google, the path should be 192.168.3.10->192.168.0.105->192.168.0.1(home router)->outside?
This is to build a flow based on Layer3. But I'm wondering if I can build flows between VLANs? According to my configuration, WAN port is port1, belongs to VLAN 5. Do you think is viable to add flows bidirectionally from VLAN 1 (machine connected) to VLAN 5 and from VLAN 5 to VLAN 1? If so, is there any examples I can flow please?
Another detail. The output of ifconfig shows eth0 interface was assigned IP 192.168.0.105, which means it's connected with my home router (192.168.0.1). So do I need to forward packets between these to IP addresses?
I really appreciate any help.
The following commands add two rules to send packet from VLAN 5 and port 5 to port 1 with VLAN 1 and vice versa:
ovs-ofctl add-flow br0 in_port=5,dl_vlan=5,actions=mod_vlan_vid:1,output:1
ovs-ofctl add-flow br0 in_port=1,dl_vlan=1,actions=mod_vlan_vid:5,output:5
I have solved this problem. Following is the solution.
The main idea is to build a linux bridge connected with OVS bridge, when I need the VLANs to be able talking with outside internet. I can use brctl to operate linux bridge. Firstly I tried:
brctl addbr br-lan
brctl addif br-lan br0
Then all the machine can access to the internet. But unfortunately, only for couple minutes. After that, the router collapsed. I could not access to the OVS router anymore unless I reset it. That could be caused by the incorrect bridge configuration. I tried many ways and finally this one works:
brctl addbr br-lan
ifconfig br-lan 192.168.3.1
brctl addif br-lan br0
ifconfig br0 0.0.0.0
I considered linux bridge br-lan should be originally connected with eth0 (wan). And as I know, br0 could means 'local', with IP address 192.168.3.1. All VLANs talk with this IP address. If I move 'local' to linux bridge which connected with wan port, it should work.
Thanks for everybody who viewed and tried to help me!

Raspberry refuses to change IP

I am running raspin on an Raspberry Pi2 and I have configured it to have a staic IP on eth0 but it never changes it sticks to its DHCP lease. This is what I have in the interfaces-file under networking.
iface eth0 inet static
address 192.168.1.60
gateway 192.168.1.1
netmask 255.255.255.0
Have I done anything wrong? Am I blind? :)
Did you try restarting network?
/etc/init.d/networking restart
Not an answer to your question, but a workaround.
Add a static IP lease rule in your DHCP server, this is going to be your router in most cases.
Try restarting the RPi or network - the edited interfaces file doesn't take effect until you do that. Some routers also don't like you requesting a certain IP, so you can also set it to DHCP on the RPi and configure the router so that it always assigns a certain IP to the device.

configure ip for bitnami owncloud virtual appliance

I installed Bitnami owncloud virtual appliance stack on Virtual box and within no time, I was able to sync files to and from this box. However, the main problem with Virtual Box is that the IP address keeps changing when the owncloud instance is powered off and then turned back on - which makes sense. Is there any way to keep the server IP static so that we don't need to configure the clients everytime the IP is changed.
You could change the config (from auto to static) in the following way
sudo vi /etc/network/interfaces (“vi” or “nano”)
iface eth0 inet static
address 192.168.0.100
# your own IP
netmask 255.255.255.0
# network mask
gateway 192.168.0.1
# standard gateway (router)
dns-nameservers 192.168.0.1 8.8.8.8
# DNS (optional)
/etc/init.d/networking restart (restart network)
ifconfig
for the IP addresses check or you “shutdown –h now” (reboot)). Please, keep in mind that multiple copies need multiple IP's. In Virtual Box remember to switch between NAT and Bridge - if required.

PXE dhcp route issue

I have PXE running on Centos 6.x. I am trying to image a server with 4 nics. eth0, eth1, eth2, eth3.
eth0 and eth1 are on the network segment that the pxe server is on. I also using this pxe server to serve up files required for the build process via a webserver.
When DHCP hands out an IP address, it does so for all the interfaces, eth0 eth1 eth2 and eth3. It also hands out a default gateway. The default gateway gets configured on eth3. This is wrong as eth3 is not connected to the network where the web server is and it cannot pull down it's files from the webserver.
the address range I am using in PXE is 192.168.20.0/24 gw 192.168.20.1. How can I get PXE DHCP to set the default gateway 192.168.20.1 on eth0 and not eth3
here is the route table
Destination Gateway Genmask Flags Metric Ref Use IFace
192.168.20.0 * 255.255.255.0 U 0 0 0 eth3
192.168.20.0 * 255.255.255.0 U 0 0 0 eth2
192.168.20.0 * 255.255.255.0 U 0 0 0 eth1
192.168.20.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.1 * 255.255.255.0 U 0 0 0 lo
default 192.168.20.1 0.0.0.0 UG 0 0 0 eth3
here is my dhcp config
ddns-update-style interim;
not authoritative;
option domain-name "mydomain.com";
option domain-name-servers 192.168.20.15;
option subnet-mask 255.255.255.0;
subnet 192.168.20.0 netmask 255.255.255.0 {
authoritative;
range 192.168.20.220 192.168.20.245;
option routers 192.168.20.1;
default-lease-time 900;
max-lease-time 1200000000;
allow unknown-clients;
allow booting;
allow bootp;
next-server 192.168.20.15;
filename "pxelinux.0";
}
Any ideas how I get the default gateway to be on eth0 so I can route properly?
Thanks - Oli
You said on question:
server with 4 nics. eth0, eth1, eth2, eth3. ...
eth0 and eth1 are on the network segment that the pxe server is on. ...
then on the answer:
another DHCP server that was issuing DHCP leases on the network that eth2 and eth3
So basically both segments DHCP servers provide same GW IP. It means that all your NIC's are on the same IP subnet 192.168.20.0/24.
Change your subnet setup.
I had another DHCP server that was issuing DHCP leases on the network that eth2 and eth3 was connected to. This interfered with the routes and caused eth0 and eth1 routing problems. I stopped the DHCP service on the network eth 2 and eth3 were on and everything was fine after that