Many attempts to set up soft routing in ubuntu

This article is automatically synchronized by Tencent Cloud + Community, the original address https://stackoverflow.club/article/ubuntu_software_router/

First try#

The network card of dhcp is set to the wired network card of server, and it is set to static ip 192.168.19.1

The client is directly connected to the server's network card, the client can obtain ip 192.168.19.150 with dhcp, but the server's wired network card also immediately obtains ip 192.168.19.151

Blog post referenced when setting up dhcp server

Soft routing transformation

ipv6 dhcp and nat

Second attempt#

Continuing the previous configuration, the difference is that the server wired network card is fixed to 192.168.19.1 in the networkmanager. After the client is connected, the ip of the server wired network card will not change.

After setting iptables with reference to pptpd V**, the curl specified network card in the client cannot obtain web page information

Third attempt#

Found that the previous settings are correct, but the name server is not specified

After waiting for a long time, such a result appears on the internal network machine

wenfeng@wenfeng-xiaoxin:~$ curl stackoverflow.club --interfaceenp3s0
curl:(6) Could not resolve host: stackoverflow.club

The problem can be solved by changing the domain name to the ip address

Fourth attempt#

After setting the dns nameserver in the dhcp server to 8.8.8.8, the client can indeed access the Internet, but it is found that the server's redsocks proxy cannot be used to access the Internet. The guess is that the server's iptables settings are incorrect.

openwrt transparent proxy Internet access

iptables is very detailed and comprehensive explanation

Useful commands#

1. curl specifies the network card##

curl --interfaceeth0-X GET http://10.200.0.33

Recommended Posts

Many attempts to set up soft routing in ubuntu
How to set up Gogs on Ubuntu 14.04
How to set static IP in ubuntu14.04
How to set up R on Ubuntu 14.04
How to set up Shiny Server on Ubuntu 14.04
How to set up time synchronization on Ubuntu 18.04
How to set up a DNS server on Ubuntu 18.04
How to set up Ghost one-click app for Ubuntu 16.04
How to set up Java Home on Ubuntu and Raspbian
How to set up a Masterless Puppet environment on Ubuntu 14.04
How to set up a firewall with UFW on Ubuntu 14.04
Detailed steps to automatically set the line number in ubuntu16.04
How to set up a production Elasticsearch cluster on Ubuntu 14.04
How to set up an Apache virtual host on Ubuntu 16.04
How to set up an Apache virtual host on Ubuntu 20.04
How to set up password authentication with Nginx on Ubuntu 14.04
How to set up vsftpd for user directories on Ubuntu 16.04
How to install Helm in Ubuntu
How to use hanlp in ubuntu
How to install mysql in Ubuntu 14.04
How to install mysql in Ubuntu 14.04
Steps to upgrade Laravel 5.4 to 5.6 in Ubuntu 16.04
How to easily compile openJDK in Ubuntu
Set UTF-8 encoding for MySQL5.7 in Ubuntu 16.04
How to install cuda10.1 driver in Ubuntu
How to add users to Sudoers in Ubuntu
How to delete redundant kernels in Ubuntu
How to delete redundant kernels in Ubuntu
Beautify Ubuntu 18.04 to Mac style in 5 minutes
How to install ROS Noetic in Ubuntu20.04
How to modify software source in Ubuntu 7.10
How to open root account in Ubuntu20.04
How to hide applications in Ubuntu Dash?
How to set static IP on Ubuntu 18.04 Server
How to modify time zone and time in ubuntu
How to configure TensorFlow use environment in Ubuntu
ubuntu16.0.4 method to set a fixed IP address
How to set static IP on Ubuntu 18.04 Server
Explain how to set static IP on ubuntu14.04
How to install python in ubuntu server environment
How to use dpkg command in Ubuntu system
How to open the ubuntu system in win10
CentOS 8 complete steps to set up automatic updates
How to set code auto prompt in python
Remotely connect to MySQL database in Ubuntu environment
5 simple ways to free up space on Ubuntu