Hi Anand,
I will say how I did it.. however there can be many other ways..
Firstly, remove the bridging.. by commenting in xend-config.sxp.. and instead
have these two lines
(network-bridge network-nat)
(vif-script vif-nat)
then.. as you can understand from the vif-nat script it sets up route
and masquerade details in the iptables, for a network with
10.0.1.0/24, somewhere hard coded..
so.. You can have a DHCP configured which can dynamically give address
on the Vifx.x (in which case the edit the network-nat and vif-nat...
and change the variable dhcp=${dhcp:-yes}) or you can have a static IP
.. in which case let the variable to as it is (dhcp=${dhcp:-no} in
network-nat and vif-nat scripts)..
Restart Xend... (Note : On Debian.. the DHCP server doesnt start..
since there are some issues, you have to start it manually by '
start-stop-daemon --start --quiet --pidfile $DHCPDPID --exec
/usr/sbin/dhcpd -q $INTERFACES' , so a manuall start would happen only
after vifx.x is UP and hence you need to first start the DomU..)
Next is the domU config ..
kernel = "/root/DIST/boot/vmlinuz-2.6-xenU"
memory = 64
vmid=1
name = "xen0"
vif = [ 'mac=00:16:3E:00:00:11' ]
disk =
['file:/mnt/fedora1.img,sda1,rw','file:/mnt/fedora1.swp,sda2,rw','file:/mnt/fedora2.img,sda3,rw']
dhcp = "dhcp"
hostname="xen0.su.qcd.in"
root="/dev/sda1 ro"
extra="3"
(Note : vif = [ '' ] is also sufficient...)
boot into domU.. and configure the eth0..
#ifconfig eth0 10.0.1.10 (anything in 10.0.1.0/24 network)
Configure the route
#route add -net 192.168.0.0/24 gw 10.0.1.128 (since my dom0 is in
192.168.0.0/24)
Now move to dom0...
configure the routes, I see that the vif-nat adds a wrong route... hence
#route add -net 10.0.1.0/24 gw 10.0.1.128 dev vif1.0 (vif1.0 is
assumed to be the frontend device for domU's ethernet..)
Configure iptables... two way Source Natting..
regards
On 2/6/06, Anand Gupta <xen.mails@xxxxxxxxx> wrote:
> I have been trying to get the networking working via route however can't get
> it running.
>
> Here is my domU config
>
> kernel = "/boot/vmlinuz-2.6.12.6-xen"
> ramdisk = "/boot/initrd-2.6.12.6-xen.img "
> memory = 32
> name = "vm01"
> dhcp ="off"
> vif = ['mac=AA:00:00:18:98:FB, vifname=vm01']
> ip="192.168.1.240"
> netmask=" 255.255.255.0"
> gateway="192.168.1.1"
> extra="selinux=0 elevator=cfq"
> disk = ['file:/root/xen/centos.4-2.img,sda1,w',
> 'file:/root/xen/centos.swap,sda2,w']
> root = "/dev/sda1 ro"
>
> /etc/sysconfig/network-scripts/ifcfg-eth0 from inside the
> domU
>
> TYPE=Ethernet
> DEVICE=eth0
> BOOTPROTO=static
> ONBOOT=yes
> BROADCAST=192.168.1.255
> IPADDR=192.168.1.240
> NETMASK=255.255.255.0
> NETWORK=192.168.1.0
> GATEWAY=192.168.1.1
>
> ifconfig from dom0
>
> eth0 Link encap:Ethernet HWaddr 00:08:A1:50:FA:19
> inet addr:192.168.1.250 Bcast:192.168.1.255 Mask:255.255.255.0
> inet6 addr: fe80::208:a1ff:fe50:fa19/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:38535 errors:0 dropped:0 overruns:0 frame:0
> TX packets:33891 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:2791353 (2.6 MiB) TX bytes:6028533 (5.7 MiB)
>
> 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:16436 Metric:1
> RX packets:44 errors:0 dropped:0 overruns:0 frame:0
> TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:4670 (4.5 KiB) TX bytes:4670 (4.5 KiB)
>
> peth0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
> inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
> UP BROADCAST RUNNING NOARP MULTICAST MTU:1500 Metric:1
> RX packets:38529 errors:0 dropped:0 overruns:0 frame:0
> TX packets:33928 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:1000
> RX bytes:2907531 (2.7 MiB) TX bytes:6056688 (5.7 MiB)
> Interrupt:16 Base address:0xa000
>
> vif0.0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
> inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:33891 errors:0 dropped:0 overruns:0 frame:0
> TX packets:38538 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:6028533 (5.7 MiB) TX bytes:2791599 (2.6 MiB)
>
> vm01 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
> inet addr: 192.168.1.250 Bcast:192.168.1.250
> Mask:255.255.255.255
> inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:38 errors:0 dropped:0 overruns:0 frame:0
> TX packets:6 errors:0 dropped:5 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:2692 (2.6 KiB) TX bytes:252 ( 252.0 b)
>
> xenbr0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF
> inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> RX packets:14264 errors:0 dropped:0 overruns:0 frame:0
> TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
> RX bytes:1016201 (992.3 KiB) TX bytes:378 (378.0 b)
>
>
> Sorry but i am confused here on how to get this working. Any help would be
> appreciated.
>
> --
> regards,
>
> Anand Gupta
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users
>
>
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
|