I want to share internet from my Linux box to other clients. My Linux box has two NICs as below:
Code: Select all
enp0s3 (Internet)
enp0s8 (Local NIC)
Code: Select all
# iptables -A FORWARD -i enp0s3 -o enp0s8 -m state --state ESTABLISHED,RELATED -j ACCEPT
# iptables -A FORWARD -i enp0s8 -o enp0s3 -j ACCEPT
# iptables -A FORWARD -j LOG
# iptables -t nat -A POSTROUTING -o enp0s3 -j MASQUERADE
Code: Select all
C:\Windows\system32>ping 4.2.2.1
Pinging 4.2.2.1 with 32 bytes of data:
Reply from 4.2.2.1: bytes=32 time=109ms TTL=125
Reply from 4.2.2.1: bytes=32 time=112ms TTL=125
Reply from 4.2.2.1: bytes=32 time=121ms TTL=125
Reply from 4.2.2.1: bytes=32 time=106ms TTL=125
Ping statistics for 4.2.2.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 106ms, Maximum = 121ms, Average = 112ms
C:\Windows\system32>ping google.com
Ping request could not find host google.com. Please check the name and try again.
C:\Windows\system32>
Thank you.