Network configuration of KVM client

Hello, I'm running FreeBSD 8.3 in a KVM VM and can't get the network working.

IP address of your server: 31.193.xxx.xxx
Gateway: 151.236.xxx.xxx
Subnet: 255.255.255.255
Primary DNS Server: 208.67.xxx.xxx
Secondary DNS Server: 208.67.yyy.yyy

rc.conf:
Code:
hostname="asdf"
ifconfig_em0="inet 31.193.xxx.xxx netmask 255.255.255.255"
defaultrouter="151.236.xxx.xxx"

ifconfig em0:
Code:
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL>
        ether x:x:x:x:x:x
        inet 31.193.xxx.xxx netmask 0xffffffff broadcast 31.193.xxx.xxx
        media Ethernet autoselecty (1000baseT <full-duplex>)
        status: active

service routing restart:
Code:
::                ::1                done
::ffff:0.0.0.0    ::1                done
route: writing to routing socket: Network is unreachable
add net default: gateway 151.236.xxx.xxx: Network is unreachable
add net ::ffff:0.0.0.0 gateway ::1
add net ::0.0.0.0: gateway ::1

Every ping responds with a "Host name lookup failure". What am I missing? To confirm that the gateway/IPs provided by my hoster are working, I quickly installed Gentoo to confirm that they are indeed correct.
 
inch said:
IP address of your server: 31.193.xxx.xxx
Gateway: 151.236.xxx.xxx
Subnet: 255.255.255.255

Code:
::                ::1                done
::ffff:0.0.0.0    ::1                done
[B]route: writing to routing socket: Network is unreachable
add net default: gateway 151.236.xxx.xxx: Network is unreachable[/B]
add net ::ffff:0.0.0.0 gateway ::1
add net ::0.0.0.0: gateway ::1

Your default gateway is outside of the subnet your interface is in. Try setting the default gateway like this:
Code:
defaultrouter="-iface em0"
 
Hi, thanks for your reply.

service routing restart
Code:
::                ::1                done
::ffff:0.0.0.0    ::1                done
route: writing to routing socket: File exists
add net default: gateway em0: route already in table
add net ::ffff:0.0.0.0 gateway ::1
add net ::0.0.0.0: gateway ::1

No more errors but the connection isn't working. inet and broadcast are the same btw.
 
Any ideas or additional information I could provide? dmesg says nothing and I don't know where to look further.
 
Back
Top