Don’t do

auto eth1
iface eth1 inet static
  address 10.1.3.33
  netmask 255.255.255.0
  gateway 10.1.3.1
  dns-nameservers 192.168.2.11 192.168.2.12

Just only

auto eth1

 

Maybe this helps?

 

Van: libvirt-users-bounces@redhat.com [mailto:libvirt-users-bounces@redhat.com] Namens Aditya Gupta
Verzonden: dinsdag 5 juli 2016 19:36
Aan: libvirt-users@redhat.com
Onderwerp: [libvirt-users] Problem in bridged networking

 

Hello,

I am facing some problems in bridged networking.

I have successfully created a bridge br0 and added a virtual machine to it. Now the address of virtual machine is 10.1.3.31. I am able to connect to this virtual machine by another computer on same network.

The virtual machine is hosting a simple python http server on port 8000, while some other service is running on port 80

When I try his on my main server :

# curl 10.1.3.31:80

Response I get is this :
* Rebuilt URL to: 10.1.3.31:80/
* Hostname was NOT found in DNS cache
*   Trying 10.1.3.31...
* Connected to 10.1.3.31 (10.1.3.31) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 10.1.3.31
> Accept: */*
>
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

But when I try this on any other port

# curl 10.1.3.31:8000

Response I get is this:
* Rebuilt URL to: 10.1.3.31:8000/
* Hostname was NOT found in DNS cache
*   Trying 10.1.3.31...
* connect to 10.1.3.31 port 8000 failed: Connection timed out
* Failed to connect to 10.1.3.31 port 8000: Connection timed out
* Closing connection 0
curl: (7) Failed to connect to 10.1.3.31 port 8000: Connection timed out

Output of iptables -L:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination        
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ftp
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:8000
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:1022

Chain FORWARD (policy DROP)
target     prot opt source               destination        
ACCEPT     all  --  anywhere             10.0.0.0/16          state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             10.0.2.4             tcp dpt:http-alt
ACCEPT     tcp  --  anywhere             10.0.2.4             tcp dpt:1883
ACCEPT     tcp  --  anywhere             10.0.2.4             tcp dpt:1883
TCPMSS     tcp  --  anywhere             anywhere             tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Output of ifconfig:
br0       Link encap:Ethernet  HWaddr 00:1a:64:c1:31:2e 
          inet addr:10.1.3.33  Bcast:10.1.3.255  Mask:255.255.255.0
          inet6 addr: fe80::21a:64ff:fec1:312e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1578351 errors:0 dropped:15619 overruns:0 frame:0
          TX packets:1327458 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:198829729 (198.8 MB)  TX bytes:346380435 (346.3 MB)

eth1      Link encap:Ethernet  HWaddr 00:1a:64:c1:31:2e 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7429105 errors:0 dropped:31238 overruns:0 frame:0
          TX packets:7684361 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:782334104 (782.3 MB)  TX bytes:2221485458 (2.2 GB)

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:65536  Metric:1
          RX packets:87278 errors:0 dropped:0 overruns:0 frame:0
          TX packets:87278 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:12350508 (12.3 MB)  TX bytes:12350508 (12.3 MB)

vnet0     Link encap:Ethernet  HWaddr fe:54:00:14:0e:98 
          inet6 addr: fe80::fc54:ff:fe14:e98/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6411332 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6277721 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:1909595770 (1.9 GB)  TX bytes:656284846 (656.2 MB)

Output of cat /etc/network/interfaces :
auto lo
iface lo inet loopback

auto eth1
iface eth1 inet static
  address 10.1.3.33
  netmask 255.255.255.0
  gateway 10.1.3.1
  dns-nameservers 192.168.2.11 192.168.2.12

auto br0
iface br0 inet static
    address 10.1.3.33
    netmask 255.255.255.0
    gateway    10.1.3.1
    dns-nameservers 192.168.2.11 192.168.2.12
    bridge_ports eth1
    bridge_stp off
    bridge_maxwait 5
    dns-nameservers 192.168.2.11 192.168.2.12