Using iptables to set ip jump after ap access

Source: Internet
Author: User
Description: A wireless APIP address is 192.168.1.126, and then eth0 (IP address is 192.168.1.59) is connected through A wired connection. then, the address assigned to A is 192.168.1.223. purpose: After Machine A is connected to the AP, access to any webpage will jump to the 61.55.167.115 (UC homepage). devices without iptables configured, such as machine B, are described as follows:
There is a wireless ap ip address 192.168.1.126, and then through the wired Internet eth0 (IP address 192.168.1.59 ),
In this case, Notebook A is connected through AP and assigned to address A as 192.168.1.223.
Purpose:
After Machine A accesses the AP, access to any webpage will jump to 61.55.167.115 (UC homepage)
Not configured IptablesThe device is like Machine B. If the device accesses the Internet after the AP is connected
Access the webpage on the Internet normally.
Iptables configuration rules:
Iptables-t nat-a prerouting-p tcp -- dport 80-s 192.168.1.223-j DNAT -- to 61.55.167.115
192.168.1.223 is the IP address of the device that requires IP redirection.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.