Find the answer to your Linux question:
Results 1 to 3 of 3
Hi folks, KVM host - Debian 5.0 VM (guest) - Ubuntu 9.10 Just created a new VM running Ubuntu 9.10 with following command; $ sudo virt-install --connect qemu:///system -n vm30ubuntu910 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,778

    Static IP can't work


    Hi folks,

    KVM
    host - Debian 5.0
    VM (guest) - Ubuntu 9.10


    Just created a new VM running Ubuntu 9.10 with following command;

    $ sudo virt-install --connect qemu:///system -n vm30ubuntu910 -r 512 --vcpus=2 -f /home/satimis/VM/vm30ubuntu910.qcow2 -s 12 -c /home/satimis/Desktop/mini_ubuntu9.10.iso --vnc --noautoconsole --os-type linux --accelerate --network=bridge:br0 --hvm


    Internet can be connected with following dynamic IP

    $ cat /etc/network/interfaces
    Code:
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet dhcp

    If change it to static IP then it can't connect Internet

    $ cat /etc/network/interfaces
    Code:
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet manual
    
    auto br0
    iface br0 inet static
            address         192.168.0.30
            netmask         255.255.255.0
            network         192.168.0.0
            broadcast       192.168.0.255
            gateway         192.168.0.1
            bridge_ports    eth0
            bridge_fd       9
            bridge_hello    2
            bridge_maxage   12
            bridge_stp      off

    $ sudo ifconfig eth0
    Code:
    eth0	Link encap: Ethernet  HWaddr 54:52:00:07:69:c8
    	Broadcase multicast  MTU:1500  Metric:1
    	RX packets:0 errors:0 dropped:0 ovrruns:0 frame:0
    	TX packets:0 errors:0 dropped:0 ovrruns:0 carrier:0	
    	collisions:0 txqueuelen:1000
    	RX bytes:0 (0.0 B)  TX bytes:0 (0.0.B)
    	Interrupt:10
    $ netstat -rn
    Code:
    Kernel IP routing table
    Destination  Gateway  Genmask  Flags  MSS Window  irtt  Iface
    Please advise how to fix the problem. TIA


    Remark:
    Other VMs works seamlessly with above static IP


    B.R.
    satimis

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    you are changing the device br0 on the guest, does it even exist? You say dynamic IP works with eth0, then you should be setting that static IP stuff for eth0.
    Code:
    auto eth0
    iface eth0 inet static
            address         192.168.0.30
            netmask         255.255.255.0
            network         192.168.0.0
            broadcast       192.168.0.255
            gateway         192.168.0.1

  3. #3
    Linux Guru
    Join Date
    Sep 2004
    Posts
    1,778
    Quote Originally Posted by coopstah13 View Post
    you are changing the device br0 on the guest, does it even exist? You say dynamic IP works with eth0, then you should be setting that static IP stuff for eth0.
    Code:
    auto eth0
    iface eth0 inet static
            address         192.168.0.30
            netmask         255.255.255.0
            network         192.168.0.0
            broadcast       192.168.0.255
            gateway         192.168.0.1
    Thanks for your advice.

    Other running guests with above setting;
    Code:
    auto br0
    iface br0 inet static
    work without problem.

    Changing them to;
    Code:
    auto eth0
    iface eth0 inet static
    didn't work at all.

    B.R.
    satimis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •