Skip to contentSkip to conversation

how to setup NAT for domU?

DISCUSSION aq 3 participants 6 messages Jan 26, 2005 – Jan 28, 2005 1 message not in the archive

lore
Share & tools
lore

aq

author
#0 lore raw

hello,

I want my domU to use NAT, so it can access the internet with private IP address, but dont know how to do that. I looked at the Xen user manual, but it doesnt mention the solution for this problem either.

Thank you a lot,
AQ

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl

#1 lore raw

I've created scripts to do that. Should they be included in the repositories (Ian, Keir)?
Here are they again.

(configure your xend-config.sxp to use them instead of the default ones, place them at /etc/xen/scripts)

Cheers
Gregor

Quoted 19 lines

hello,

I want my domU to use NAT, so it can access the internet with private IP address, but dont know how to do that. I looked at the Xen user manual, but it doesnt mention the solution for this problem either.

Thank you a lot,
AQ

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

Signature · 1 line
Quidquid latine dictum sit, altum viditur --- Anon
#2 lore raw

For those who prefer patching instead of coping the files from the archive the patchfile is attached to the email.

Cheers
Gregor

Quoted 29 lines

I've created scripts to do that. Should they be included in the repositories (Ian, Keir)?
Here are they again.

(configure your xend-config.sxp to use them instead of the default ones, place them at /etc/xen/scripts)

Cheers
Gregor

Quoted 19 lines

hello,

I want my domU to use NAT, so it can access the internet with private IP address, but dont know how to do that. I looked at the Xen user manual, but it doesnt mention the solution for this problem either.

Thank you a lot,
AQ

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

Signature · 1 line
Quidquid latine dictum sit, altum viditur --- Anon
linux-2.6.10-xen-sparse/arch/xen/configs/xen0_defconfig +12 -3
diff -Nru a/linux-2.6.10-xen-sparse/arch/xen/configs/xen0_defconfig b/linux-2.6.10-xen-sparse/arch/xen/configs/xen0_defconfig
@@ -501,7 +501,7 @@
 # CONFIG_IP_NF_QUEUE is not set
 CONFIG_IP_NF_IPTABLES=m
 # CONFIG_IP_NF_MATCH_LIMIT is not set
-# CONFIG_IP_NF_MATCH_IPRANGE is not set
+CONFIG_IP_NF_MATCH_IPRANGE=m
 # CONFIG_IP_NF_MATCH_MAC is not set
 # CONFIG_IP_NF_MATCH_PKTTYPE is not set
 # CONFIG_IP_NF_MATCH_MARK is not set
@@ -524,11 +524,20 @@
 # CONFIG_IP_NF_MATCH_SCTP is not set
 # CONFIG_IP_NF_MATCH_COMMENT is not set
 # CONFIG_IP_NF_MATCH_HASHLIMIT is not set
-# CONFIG_IP_NF_FILTER is not set
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
 # CONFIG_IP_NF_TARGET_LOG is not set
 # CONFIG_IP_NF_TARGET_ULOG is not set
 # CONFIG_IP_NF_TARGET_TCPMSS is not set
-# CONFIG_IP_NF_NAT is not set
+CONFIG_IP_NF_NAT=m
+CONFIG_IP_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+# CONFIG_IP_NF_TARGET_REDIRECT is not set
+# CONFIG_IP_NF_TARGET_NETMAP is not set
+# CONFIG_IP_NF_TARGET_SAME is not set
+# CONFIG_IP_NF_NAT_LOCAL is not set
+# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
+CONFIG_IP_NF_NAT_FTP=m
 # CONFIG_IP_NF_MANGLE is not set
 # CONFIG_IP_NF_RAW is not set
 # CONFIG_IP_NF_ARPTABLES is not set
tools/examples/network-nat new file +77 -0

77 lines not on this page · raw message

tools/examples/vif-nat new file +66 -0

66 lines not on this page · raw message

tools/examples/xmexample3 new file +120 -0

120 lines not on this page · raw message

#3 lore raw
In reply to Grzegorz Milos

Gregor, in your xmexample script you have:

vif = [ 'ip=192.168.%d.1/24' % (vmid)]

I have a much simpler config file, which has:

vif = [ 'ip=192.168.2.1/24']

...which I tried to use but I get an error from xm create. Looking at create.py (xen-unstable) , I don't see a provision to parse assignment for ip= for vif:

gopts.var('vif', val="mac=MAC,bridge=BRIDGE,script=SCRIPT,backend=DOM",

Am I missing something, or is it possible you are using this on an unreleased build?

Thanks,

Andrew Theurer

Quoted 34 lines · Grzegorz Milos

I've created scripts to do that. Should they be included in the repositories (Ian, Keir)? Here are they again.

(configure your xend-config.sxp to use them instead of the default ones, place them at /etc/xen/scripts)

Cheers
Gregor

Quoted 21 lines

hello,

I want my domU to use NAT, so it can access the internet with private IP address, but dont know how to do that. I looked at the Xen user manual, but it doesnt mention the solution for this problem either.

Thank you a lot,
AQ

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl

#4 lore raw
Quoted 3 lines

Gregor, in your xmexample script you have:

vif = [ 'ip=192.168.%d.1/24' % (vmid)]

The way the default setup (xmexample) works is as follows:
in domain 0 - vif gets ip = 192.168.vmid.1
in domU - eth0 gets ip = 192.168.vmid.2
this way we can easily update the routing tables in dom0. There can be up to 255 unprivileged domains (which is plenty).

Quoted 3 lines

I have a much simpler config file, which has:

vif = [ 'ip=192.168.2.1/24']

This way all the virtual interfaces in dom0 would be getting the same ip, which will not work for more then one domU.

Quoted 1 line

...which I tried to use but I get an error from xm create.  Looking at

What is the error? Does it happen when you are trying to set up the first unprivileged domain or any subsequent ones. What IP address do you give to eth0 in domU?

Quoted 4 lines

create.py (xen-unstable) , I don't see a provision to parse assignment for ip= for vif:

gopts.var('vif', val="mac=MAC,bridge=BRIDGE,script=SCRIPT,backend=DOM",

The whole 'ip=192.168.whatever.1' gets passed to vif-nat script (/etc/xen/scripts/vif-nat) which then uses it in to bring the vif up.

Quoted 2 lines

Am I missing something, or is it possible you are using this on an unreleased build?

That should work for both the unstable and testing trees. Maybe you have not reinstalled the tools, and the vif-nat and network-nat scripts did not get copied to /etc/xen/scripts? Have you modified xend-config.sxp to use the new scripts?

Cheers
Gregor

Quoted 34 lines

Thanks,

Andrew Theurer

Quoted 29 lines · Grzegorz Milos

I've created scripts to do that. Should they be included in the repositories (Ian, Keir)?
Here are they again.

(configure your xend-config.sxp to use them instead of the default ones, place them at /etc/xen/scripts)

Cheers
Gregor

Quoted 19 lines

hello,

I want my domU to use NAT, so it can access the internet with private IP address, but dont know how to do that. I looked at the Xen user manual, but it doesnt mention the solution for this problem either.

Thank you a lot,
AQ

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

Signature · 8 lines
Quidquid latine dictum sit, altum viditur --- Anon


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 12 lines · Gregor Milos
Quoted 5 lines

Gregor, in your xmexample script you have:

vif = [ 'ip=192.168.%d.1/24' % (vmid)]

The way the default setup (xmexample) works is as follows:
in domain 0 - vif gets ip = 192.168.vmid.1
in domU - eth0 gets ip = 192.168.vmid.2
this way we can easily update the routing tables in dom0. There can be up to 255 unprivileged domains (which is plenty).

OK, that's exactly what I wanted to do.

Quoted 11 lines
Quoted 7 lines

I have a much simpler config file, which has:

vif = [ 'ip=192.168.2.1/24']

This way all the virtual interfaces in dom0 would be getting the same ip, which will not work for more then one domU.

Actually I have a diferent file for each vmid, generated by bash scripts, with have a different 192.168.vmid.1, so I think our intent is the same, just different implemtations. My way was driven by my lack of python experience :)

Quoted 9 lines
Quoted 5 lines

...which I tried to use but I get an error from xm create. Looking at

What is the error? Does it happen when you are trying to set up the first unprivileged domain or any subsequent ones. What IP address do you give to eth0 in domU?

I don't have the error recordred, but I think it was a python parsing error. Perhaps I just didn't get the format correctly. I cannot reproduce at the moment, because apparantly I have really screwed somthing up by trying the unstable tree, and so far I have not been able to get 2.0-testing or 2.0.1 running again (and 2.0.3 has always stuck at "Scrubbing memory..").

I'll try to get back where I started, 2.0.1 with the error reproduced. Hopefully it's just an error on my part. Thanks for your help!

-Andrew Theurer

-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl