0

I have a web app running on WebSphere Liberty on port 9080 on Ubuntu v18.04 on VirtualBox. The guest is running on 10.0.0.11

The webapp it is only available on localhost, not on 10.0.0.11

How do I configure Ubuntu to listen to 10.0.0.11?

  • The network is bridged.
  • The firewall is disabled.
  • Host is on 10.0.0.2
  • The guest (Ubuntu) is on 10.0.0.11
  • I can ping 10.0.0.11 and I can ssh into it.
  • I am not using a name server, DNS is not required.
  • Does ip route give any clues?
daniel@daniel:~$ ip route
default via 10.0.0.1 dev enp0s3 proto dhcp metric 100 
10.0.0.0/24 dev enp0s3 proto kernel scope link src 10.0.0.11 metric 100 
169.254.0.0/16 dev enp0s3 scope link metric 1000 

What arcane bit of networking knowledge am I missing?

2 Answers 2

0

You have to check if the ip ifconfig shows you are on the same network as the host,

192.168.1.X or  10.0.0.X

If you don't get a ip from your router then you need to set it manually:

ifconfig eth0 192.168.1.11 netmask 255.255.255.0 broadcast 192.168.1.1

If that's not enough:

Maybe you need to set up dhcp if ti is not enabled:

To configure your Ubuntu distribution to be a DHCP client, you need to modify the /etc/network/interfaces file. You will need to add the following line to the file(INTERFACE is the name Linux gave your network card and you find it with ifconfig):

iface INTERFACE inet dhcp

Maybe you need to modify this file manually.To make changes open the interfaces file using nano and set the values in the file as necessary. First change dhcp to static, then add lines for address, netmask, gateway, and DNS servers according to your network.

sudo nano /etc/network/interfaces

it should look like this(eho0 is the networkCardName and you find it with ifconfig):

iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254

To setup eth0 to dhcp, enter:

auto eth0
iface eth0 inet dhcp

To expose your virtualMachine to your local network you want to set network to BridgedAdapter in VirtualBox

settings->Network->Adapter1 or add another(Adapter2)->attatched to:->Bridged Adapter

then you get a ip from you router when you connect and then you can ssh and ping the virtualMachine on you network and from other hosts.

Set DNS Servers:

You need to configure the /etc/network/interfaces file if you want to change your DNS server via the command line.

It should look something like this:

# The loopback network interface  
auto lo  
iface lo inet loopback  


# The primary network interface  
auto eth0 
iface eth0 inet static  
address 192.168.X.X
netmask 255.255.255.0
gateway 192.168.X.X
dns-nameservers X.X.X.X 

If you have more than one DNS server, just add a space between each:

dns-nameservers X.X.X.X Y.Y.Y.Y Z.Z.Z.Z

Just replace the Xs, Ys, and Zs with your own IPs of the DNS servers of choice, and when this is done, run this command to update the settings:

sudo ifdown eth0 && sudo ifup eth0
0

WebSphere Liberty server.xml configuration setting needs a host element as follows:

<httpEndpoint id="defaultHttpEndpoint"  
              host="*"  
              httpPort="9080"  
              httpsPort="9443" /> 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .