LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-27-2023, 10:46 AM   #1
andrewK1602
LQ Newbie
 
Registered: Jul 2023
Posts: 3

Rep: Reputation: 0
Ubuntu 22.04 NAT


Hi all,

I’ve successfully set-up and configured a NAT router in Ubuntu. Doing a ‘What is my IP’ confirms this is working. Clients can ping the router and get a response and vice-versa.

The one issue that I do seem to have is that when computers boot up and joining the network, or when a new wireless network is selected on a laptop, for example, Internet access seems to take a good 2-3 minutes if not longer to actually work. Browsers show the ‘cannot be displayed’ message during this time, but then it eventually kicks-in.

Is there something obvious that I am missing?

Thanks,

Andrew
 
Old 07-27-2023, 08:17 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,853

Rep: Reputation: 161Reputation: 161
Which PC has the issue, the Internet access take a 2-3 minutes to be good? Is it rebooted PC or the NAT router on Ubuntu?
 
Old 07-27-2023, 08:56 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,725

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
Welcome to LinuxQuestions.

Please post the hardware specifications. I assume this happens only for wireless devices? Does this happen for any device no matter how many are connected at one time, even with only one?
 
Old 07-28-2023, 03:38 AM   #4
andrewK1602
LQ Newbie
 
Registered: Jul 2023
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you for your responses.

The initial slow connection is on the client PCs and the same happens when I connect another device, wireless or wired. Once the connection has been established, everything works as expected, it just seems to be the initial connection.

Currently, this is being tested with two MacOS client devices and the same result occurs.

The Ubuntu server is set-up with 4GB Ram, 2 Core, 160GB SSD drive and is exclusively for NAT. There are no other services needed or running on this server.

Cheers

Last edited by andrewK1602; 07-28-2023 at 03:39 AM.
 
Old 07-28-2023, 04:25 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,725

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
Wired may be easier to diagnose. Do you have two wired adapters on the server?
Are they both 1 GB? How did you configure NAT? Did you follow an online guide?
 
Old 07-28-2023, 04:56 AM   #6
andrewK1602
LQ Newbie
 
Registered: Jul 2023
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks Michael. Both ethernets are 1gb/s.

I followed this guide for setting up the NAT: https://www.networkreverse.com/2020/...th-ubuntu.html

The rules on the NAT have been configured in the following location (Screenshot attached)
Code:
/etc/iptables/rules.v4
Ubuntu is set to use a static IP on the WAN interface and is set via
Code:
/etc/netplan/50-cloud-init.yaml
Cheers
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2023-07-28 at 10.54.08.png
Views:	161
Size:	8.7 KB
ID:	41391  
 
Old 07-28-2023, 08:53 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,725

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
Without knowing anything else about how the server is configured it is difficult to say what might be wrong.

If you followed the guide the LAN is configured as 10.10.10.0/24 (255.255.255.0) with the server setup as 10.10.10.1. The available client IP address range is 10.10.10.2 - 10.10.10.254. If you are going to use static IP addresses for the clients then each needs a unique address.

Since you posted you are using a static IP address for the WAN side if you are actually using a private address then it should be a different subnet from the LAN side.
 
  


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
NAT and NAT Server behind its own NAT(private network) zeusys Linux - Networking 1 06-08-2011 06:22 PM
Difference between NAT and NO NAT plisken Linux - Networking 1 01-10-2008 11:53 AM
I configure NAT and use "services ..." to save it but when I reboot there is no nat bruack Linux - Software 4 09-01-2004 02:38 AM
Susefirewall2 Nat Problem / nat 1:1 trubi Linux - Distributions 0 07-20-2004 05:50 AM
What's the difference between Linux-NAT and Sygate-NAT? yuzuohong Linux - Networking 0 08-07-2002 04:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:19 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