Quantcast
Channel: Ubuntu Forums - Networking & Wireless
Viewing all articles
Browse latest Browse all 23300

virtualbox ubuntu connect lan inside ubuntu vps

$
0
0
have vps with ip 172.16.22.92 and vm inside this vps and want to have ip 172.16.22.101. vm is virtualbox vm and os of both are ubuntu. why can not see vm from lan or can not see gateway from vm? ping gateway from vm get destination host unreachable. ping gateway from vps is correct and get connect.
========================output of following command on vps. command is: vboxmanage showvminfo kmaster |grep "NIC"
Code:

  NIC 1:                      MAC: 0800274602EE, Attachment: NAT,  Cable connected: on, Trace: off (file: none), Type: 82540EM,
Reported  speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group:  none NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64),
TCP Window  (send:64, receive: 64) NIC 1 Rule(0):  name = tcp22321, protocol = tcp, host ip = , host port =  22321, guest ip = , guest port = 22
NIC 2:                      MAC: 080027AF33C0, Attachment: Bridged  Interface 'ens160', Cable connected: on, Trace: off (file: none), Type:  82540EM,
Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny,  Bandwidth group: none


========================output of following command on vps: command is: ip a


Code:

 
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever

2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:a3:1c:76 brd ff:ff:ff:ff:ff:ff altname enp3s0 inet 172.16.22.92/24 metric 100 brd 172.16.22.255 scope global dynamic ens160
valid_lft 1285313sec preferred_lft 1285313sec inet6 fe80::250:56ff:fea3:1c76/64 scope link
valid_lft forever preferred_lft forever

3: vboxnet0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff inet 172.42.42.1/24 brd 172.42.42.255 scope global vboxnet0
valid_lft forever preferred_lft forever inet6 fe80::800:27ff:fe00:0/64 scope link valid_lft forever preferred_lft forever


========================output of following file on vm inside vps: file is: /etc/netplan/50-vagrant.yaml



Code:

network: version: 2 renderer: networkd ethernets: eth1: addresses: - 172.16.22.101/24 routes: - to: 0.0.0.0/0 via: 172.16.22.1

========================on vm inside vps: command is: ip a

Code:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state  UNKNOWN group default qlen 1000                                                                                         
link/loopback  00:00:00:00:00:00 brd 00:00:00:00:00:00                                                                                                                           
 inet 127.0.0.1/8 scope host lo                                                                                                                                                       
valid_lft forever  preferred_lft forever                                                                                                                                     
inet6 ::1/128 scope host noprefixroute                                                                                                                                               
valid_lft forever  preferred_lft forever

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel  state UP group default qlen 1000
link/ether 08:00:27:46:02:ee brd ff:ff:ff:ff:ff:ff altname enp0s3 inet 10.0.2.15/24 metric 100 brd 10.0.2.255 scope global dynamic eth0
valid_lft 86230sec preferred_lft 86230sec inet6 fe80::a00:27ff:fe46:2ee/64 scope link valid_lft forever preferred_lft forever

3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel  state UP group default qlen 1000
link/ether 08:00:27:af:33:c0 brd ff:ff:ff:ff:ff:ff altname enp0s8 inet 172.16.22.101/24 brd 172.16.22.255 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:feaf:33c0/64 scope link valid_lft forever preferred_lft forever

4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc  noqueue state DOWN group default link/ether 02:42:b8:bd:23:4c brd ff:ff:ff:ff:ff:ff inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever


Viewing all articles
Browse latest Browse all 23300

Trending Articles