当前位置:网站首页>Several application scenarios of NAT
Several application scenarios of NAT
2022-07-25 01:38:00 【Wakke Wang】
1、 Let other network ports in the same device access the Internet
The functions of the following figure , It's really just a 4G Router , You can connect to the Internet by cable , You can also access the Internet wirelessly .
Can pass NAT Rules are easily implemented .

such as ,LTE Module dialing succeeded , The name of the network port is lte0
in the light of wifi ap :
service isc-dhcp-server stop
sed "/INTERFACES=/c\INTERFACES=wlan0" -i /etc/default/isc-dhcp-server
sed "/interface=/c\interface=wlan0" -i /etc/hostapd/hostapd.conf
hostapd -B /etc/hostapd/hostapd.conf
sleep 1
ifconfig wlan0 10.5.5.1/24
service isc-dhcp-server restart
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o lte0 -j MASQUERADE
iptable perform Masquerade, Source IP Change to host network card IP, Then send the request to the Internet server .
The principle is as follows :

$ cat /etc/default/isc-dhcp-server
# Defaults for isc-dhcp-server initscript
# sourced by /etc/init.d/isc-dhcp-server
# installed at /etc/default/isc-dhcp-server by the maintainer scripts
#
# This is a POSIX shell fragment
#
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPD_CONF=/etc/dhcp/dhcpd.conf
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPD_PID=/var/run/dhcpd.pid
# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="wlp1s0"
$ cat /etc/hostapd/hostapd.conf
interface=wlP2p1s0
driver=nl80211
ssid=test
channel=6
hw_mode=g
auth_algs=1
wpa=3
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
边栏推荐
- [C + + primer notes] Chapter 6 functions
- Take C language from 0 to 1 - program structure and use examples
- Chip sold at sand price: Lei Jun's dream was "ruined" by this company
- Alibaba cloud released the white paper "upgrade - standardization of data warehouse upgrade delivery"
- Which bank outlet in Zhejiang can buy REITs fund products?
- C traps and defects Chapter 2 lexical "traps" 2.4 switch statements
- Research and application of scientific data management strategy for high energy synchrotron radiation source
- Fabric. JS centered element
- Top priority of dry goods: common indicators and terms in data analysis!
- Interview questions
猜你喜欢

Rightmost × Microframe, high quality heif image coding and compression technology

Luo min cannot become Dong Yuhui

How to implement a state machine?

Prosci anti-CD22 antibody epratuzum28 flow cytometry display

Why is the exclude or include attribute setting of the < keep alive > component invalid

Game partner topic: the cooperation between breederdao and monkeyleague kicked off

Visual studio code installation package download slow & Installation & environment configuration & new one-stop explanation

How to implement the server anti blackmail virus system is a problem we have to consider

Top priority of dry goods: common indicators and terms in data analysis!

Document the use of anti shake in packaged components and projects
随机推荐
[C + + primer notes] Chapter 8 IO Library
Three modes of executing programs, memory and cache
Windows security hardening -- close unnecessary ports
Take C language from 0 to 1 - program structure and use examples
Resolution of multi thread conflict lock
Prosci anti-CD22 antibody epratuzum28 flow cytometry display
C traps and defects Chapter 2 lexical "traps" 2.4 switch statements
Dynamic memory development
Start to build a three node Eureka cluster
Detailed explanation of zero length array in C language (1) [information at the end of the article]
Screenshot of Baidu map
Fraud detection using CSP
From casting sword to defending sword: the way to build the efficiency platform of didi project
A string "0" was actually the culprit of the collapse of station b
Introduction to thread pool
Latest information of 2022 cloud computing skills competition
Nacos hand to hand teaching [i] dynamic configuration of Nacos
Specificity and five applications of Worthington alcohol dehydrogenase
How to implement the server anti blackmail virus system is a problem we have to consider
Download files and web pages with WGet