惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
N
News | PayPal Newsroom
S
Security @ Cisco Blogs
Schneier on Security
Schneier on Security
V
V2EX - 技术
S
Secure Thoughts
W
WeLiveSecurity
Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
S
Securelist
S
Security Archives - TechRepublic
Know Your Adversary
Know Your Adversary
V
Vulnerabilities – Threatpost
Security Latest
Security Latest
Recent Commits to openclaw:main
Recent Commits to openclaw:main
G
GRAHAM CLULEY
H
Hacker News: Front Page
Microsoft Azure Blog
Microsoft Azure Blog
I
Intezer
Google Online Security Blog
Google Online Security Blog
美团技术团队
阮一峰的网络日志
阮一峰的网络日志
T
The Exploit Database - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Webroot Blog
Webroot Blog
Jina AI
Jina AI
Engineering at Meta
Engineering at Meta
P
Proofpoint News Feed
The Cloudflare Blog
I
InfoQ
L
LangChain Blog
U
Unit 42
P
Proofpoint News Feed
S
Schneier on Security
S
Security Affairs
Y
Y Combinator Blog
T
Tenable Blog
N
News and Events Feed by Topic
MyScale Blog
MyScale Blog
量子位
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
博客园 - 聂微东
D
Darknet – Hacking Tools, Hacker News & Cyber Security
GbyAI
GbyAI
AWS News Blog
AWS News Blog

Kian Bradley’s Blog

Resurrecting a dead torrent tracker and finding 3 million peers Resurrecting a dead torrent tracker and finding 3 million peers Supporting modern https on Windows XP Supporting modern https on Windows XP Running rumprun for Xen in Ubuntu 16.04 Running rumprun for Xen in Ubuntu 16.04 Setting up NAT networking in Xen using virsh Setting up Xen in Ubuntu 16.04 Setting up Xen in Ubuntu 16.04
Setting up NAT networking in Xen using virsh
Kian Bradley · 2016-08-26 · via Kian Bradley’s Blog

There are two main ways to set up networking in Xen. You can use a bridged network, or you can set up NAT. A bridged network means that the guest domains will talk to the router directly to get an IP address. NAT networking creates a subnet local to your machine, and the guest domains will talk to dom0 to get an IP address.

Neither one is better than the other, really. Bridged networking is slightly simpler if you want something that just works. NAT-ing will create an internal network that allows for simpler local (domain-to-domain) communication and greater control over external communication. The downside is that you’ll need to set up a static IP per guest and set iptables rules to allow for external communication.

Installing virsh

Install libvirt:

sudo apt-get install libvirt-bin libvirt0

Check that it’s been installed, and that the default network is in place:

virsh net-list --all

Set static IP, associate each IP with a mac address

Edit the default virsh config:

sudo virsh net-edit default

Under the <dhcp> tag, add a listing for each guest. The name can be whatever you want it to be.

For the MAC address, the first 3 bytes should not be changed, this is the OUI assigned to the Xen project. The last 3 can be whatever you like.

This is my DHCP configuration, with three guest domains configured:

<dhcp>
	<range start='192.168.122.128' end='192.168.122.254'/>
	<host mac='00:16:3e:00:00:02' name='osv' ip='192.168.122.2'/>
	<host mac='00:16:3e:00:00:03' name='ubuntu' ip='192.168.122.3'/>
	<host mac='00:16:3e:00:00:04' name='rumprun' ip='192.168.122.4'/>
</dhcp>

Setting up a guest domain with NAT

standard xen cfg

In your Xen guest configuration file, add the following virtual interface, where mac corrosponds with the virsh configuration:

vif = ['mac=00:16:3e:00:00:03,bridge=virbr0']

rumprun unikernel

The rumprun unikernel is launched with the rumprun script. Here “newnet” is used internally by the script and can be set to whatever you like. rumprun_image.bin represents the baked rumprun binary you are running:

rumprun -S xen -id -I newnet,xenif,'bridge=virbr0,mac=00:16:3e:00:00:04' -W newnet,inet,dhcp rumprun_image.bin0