LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-27-2020, 06:27 AM   #16
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309

in that case you need to use an address between the lower and upper limits.
also gateway is probably the same as your dhcp server.
 
Old 10-27-2020, 06:27 AM   #17
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
Quote:
Originally Posted by anamnedelcu View Post
Before I set it, it was dynamically allocated.
obviously, but the question was: exactly what was allocated in that case.
 
Old 10-27-2020, 06:28 AM   #18
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
I assume you are running version 6 and I confess to not having played with its default settings much. looks like it should be using 10.0.0.2.x/24

Is this a guest you installed your self?

I have seen other posts with a VB vm where it was using 192.168.x.x/24 and the NAT gateway was 192.168.x.2.

Since I am making some bad assumptions by reference to pinging router are you referring to the VB internal NAT gateway or the physical router on the LAN? Do you know the LAN network settings?
 
Old 10-27-2020, 07:15 AM   #19
anamnedelcu
LQ Newbie
 
Registered: Oct 2020
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
in that case you need to use an address between the lower and upper limits.
also gateway is probably the same as your dhcp server.
The thing is that I have a homework to do and one of the requirements is that the server has the ip address 192.168.101.1. Also, i thought that the gateway and DNS should have the ip address of the physical router of the LAN.
 
Old 10-27-2020, 07:18 AM   #20
anamnedelcu
LQ Newbie
 
Registered: Oct 2020
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
I assume you are running version 6 and I confess to not having played with its default settings much. looks like it should be using 10.0.0.2.x/24

Is this a guest you installed your self?

I have seen other posts with a VB vm where it was using 192.168.x.x/24 and the NAT gateway was 192.168.x.2.

Since I am making some bad assumptions by reference to pinging router are you referring to the VB internal NAT gateway or the physical router on the LAN? Do you know the LAN network settings?

I was referring to the gateway I set up in /etc/network/interfaces.
 
Old 10-27-2020, 07:24 AM   #21
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
we still have no idea about your setup and configuration, therefore hard to way anything.
So you have a router, a dhcp server, a host, VMs, and who knows what. Need to know how are these devices connected to each other and to the internet, how are they configured and what do you want to achieve exactly (access internet from where?).
 
Old 10-27-2020, 07:32 AM   #22
anamnedelcu
LQ Newbie
 
Registered: Oct 2020
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
we still have no idea about your setup and configuration, therefore hard to way anything.
So you have a router, a dhcp server, a host, VMs, and who knows what. Need to know how are these devices connected to each other and to the internet, how are they configured and what do you want to achieve exactly (access internet from where?).
So, I have a physical router, a laptop that is connected to the router via Wi-Fi and on that laptop I have installed VirtualBox. Within VirtualBox, I have 2 VMs: one of them should act as a server and the other one should be the client. On the server VM I tried to set a static IP address. After I modified the /etc/network/interfaces and /etc/resolv.conf, I rebooted the VM and there was no internet connection. The only address I can ping is the address I chose for the ethernet interface (192.168.101.1).


/etc/network/interfaces:
auto enp0s3
iface enp0s3 inet static
address 192.168.101.1
netmask 255.255.255.0
network 192.168.101.0
broadcast 192.168.101.255
gateway 192.168.0.1 (this is the ip address of my physical router)
dns-nameservers 192.168.0.1 8.8.8.8 8.8.4.4

/etc/resolv.conf
nameserver 192.168.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4
 
Old 10-27-2020, 07:56 AM   #23
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Your interface setup is:

Code:
address 192.168.101.1
netmask 255.255.255.0
But your gateway is not on that subnet (since third octet is different):

Code:
gateway 192.168.0.1
So your interface has no idea how to reach the gateway. To send packets between two different subnets, you need a router in between.
 
Old 10-27-2020, 08:01 AM   #24
anamnedelcu
LQ Newbie
 
Registered: Oct 2020
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
Your interface setup is:

Code:
address 192.168.101.1
netmask 255.255.255.0
But your gateway is not on that subnet (since third octet is different):

Code:
gateway 192.168.0.1
So your interface has no idea how to reach the gateway. To send packets between two different subnets, you need a router in between.
Ok so, I have a question. Does the gateway and DNS addresses have to be the same as my physical router's ip address?
 
Old 10-27-2020, 08:28 AM   #25
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
Quote:
Originally Posted by anamnedelcu View Post
Ok so, I have a question. Does the gateway and DNS addresses have to be the same as my physical router's ip address?
no, you can install your DNS server (if you wish) anywhere you want, and also there are cases when the gateway is not the same as the router, but in small networks these IPs are usually the same.
 
Old 10-27-2020, 08:29 AM   #26
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Does the assignment or did the instructor explain how to configure the VB network? You posted your using NAT but the picture posted shows host only networking. Can post more of the details of your homework assignment? Does your server have two network adapters?

Host only network adapter does not allow traffic outside its internal network. In addition the client VM must be on the same host network as the server. If the client is still configured using DHCP then you need to change the host only DHCP server to match the static work address of your server.
 
Old 10-27-2020, 08:29 AM   #27
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,627

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
FWIW: if your IP address needs to be fixed and have access external to the host you want your interface to be in BRIDGED mode rather than NAT mode. Network settings then will look much like those on the host, because it is actually bridged to that same network. DHCP address range of the DHCP server but on the same subnet.


Your understanding of the networking needs to be improved. Some reading might be required. This experiment should help with that.

Last edited by wpeckham; 10-27-2020 at 08:33 AM.
 
Old 10-27-2020, 08:38 AM   #28
anamnedelcu
LQ Newbie
 
Registered: Oct 2020
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
I assume you are running version 6 and I confess to not having played with its default settings much. looks like it should be using 10.0.0.2.x/24

Is this a guest you installed your self?

I have seen other posts with a VB vm where it was using 192.168.x.x/24 and the NAT gateway was 192.168.x.2.

Since I am making some bad assumptions by reference to pinging router are you referring to the VB internal NAT gateway or the physical router on the LAN? Do you know the LAN network settings?
Quote:
Originally Posted by michaelk View Post
Does the assignment or did the instructor explain how to configure the VB network? You posted your using NAT but the picture posted shows host only networking. Can post more of the details of your homework assignment? Does your server have two network adapters?

Host only network adapter does not allow traffic outside its internal network. In addition the client VM must be on the same host network as the server. If the client is still configured using DHCP then you need to change the host only DHCP server to match the static work address of your server.
I'll explain to you my assignment. I have to create 2 VMs. One should act as a server and the other one should act as a client. The server's IP address has to be 192.168.101.1/24. On the server VM I have to configure three services: dhcp, dns and ntp. The first thing I tried to do was to set the static ip address of the server. But after I tried this, I had no internet connection so I tried to find the solution on google, youtube, basically everywhere on the internet but I couldn't find any.
 
Old 10-27-2020, 08:57 AM   #29
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
From the assignment I assume the server is acting like a gateway for the client if I understand correctly. That means the server needs two network adapters.

The WAN side should be configured as bridge mode, the other internal. The WAN adapter should be configured using DHCP which will provide the DNS and gateway to your LAN. The second adapter will be configured with a static IP address. No gateway or DNS needs to be configured. If the server is running a GUI you can configure a static IP address via the network manager applet.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix and sendmail - outgoing ip address and 2 static ip address problem xmail400x Linux - Networking 1 01-06-2016 02:29 PM
setting static IP on linux PCs with no static IP address from internet provider? solvetek Linux - Networking 1 10-22-2011 08:04 AM
[SOLVED] Processes ,the stack and static memory: How can the stack be considered static? theKbStockpiler Programming 8 05-20-2010 09:01 AM
Set IP address to static from DHCP assigned address jborn Linux - Networking 4 02-02-2007 08:38 PM
[SOLVED] Converting static IP-address to dynamic IP-address Blue_Ice Linux - Networking 3 07-20-2006 03:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration