Answer the question
In order to leave comments, you need to log in
Network setup, two network cards?
Good afternoon, I have two ports in the server, the first port is a van port, the second port needs to be done so that it is a local network and it has access to the Internet from the first port, how to implement it?
Answer the question
In order to leave comments, you need to log in
write this
sudo iptables --flush
sudo iptables --table nat --flush
sudo iptables --delete-chain
sudo iptables --table nat --delete-chain
sudo iptables -A FORWARD -i eth0 -o eth1 -s 192.168.1.0 /24 (set your LAN network address) -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A POSTROUTING -t nat -j MASQUERADE
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question