0

On my CentOS system, Wifi Interface (wlan0) is connected to the internet through an access point. The IPV4 for it is assigned dynamically by the ISP. The eth0 for this machine is manually configured to use 172.172.4.3/16

I have another CentOS box which is connected to the box above through eth0 interface (wired LAN) it is a direct connection without any intermediate devices like switches. The IP is manually configured to 172.172.4.2/16

I want to be able to access the Wifi internet available @172.172.4.3 on the machine 172.172.4.2. I searched the internet and came across some settings like marking the Wifi as Shared or configuring iptables, but none of them worked.

How do I go about it?

0

3 Answers 3

1

You've painted yourself into a corner. You've setup your network to be bridged, not routed (IPs in same subnet). Yet you have a Wifi client connection, which cannot be bridged to.

The Wifi specification prohibits bridging to an access point client connection. The access point will not allow it. That's why WDS must be configured in both access points. Neither supports bridging to an ordinary client.

It's time to rethink your setup. Here are four possible options:

  1. Add a second access point and configure WDS in both access points. Connect wired machines to the second access point. This assumes your existing access point supports WDS.

  2. Use a client station device. Connect this machine to that station device. That way, no bridging will be needed because each client connection will have only a single machine.

  3. Add a second wireless router that can run aftermarket firmware like Tomato or OpenWRT. These have a feature called "client bridging" that uses a form of NAT to make this work (making more than one system appear to have the same hardware address). You can then connect any number of wired clients to this device. This won't require any changes to your existing access point.

  4. Add a regular wireless interface to this machine and let it make its own client connection to the access point.

Edit

If you want to use NAT, you need to assign each end of the private link between the two machines a private IP address. For example, you can use 192.168.200.1/24 and 192.168.200.2/24. You will also need to make the private address of the machine doing NAT (the one with both connections) the other one's default gateway and you'll need to set its DNS server IPs manually.

1
  • If need be, I can change the manually configured IPs.
    – User1241
    Jul 11, 2012 at 13:25
1

Are you aware that the IPs in the range 172.172.0.0/16 are public IPs ?

This might be a problem if you want to route/nat your internet access in your private network.

Try remapping your network to something like 172.24.0.0/16 and then apply allquixotic's solution.

0

See http://www.revsys.com/writings/quicktips/nat.html

Also, be aware that the "/16" you're specifying is actually an IP address range, not a specific IP. See http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing . If you are trying to assign a specific static IP address to a host and you are specifying /16 at the end, you are doing it wrong. You would only need to use a CIDR if you are specifying the DHCP provisioning range on the host side (the "4.3" box in your case) -- the DHCP server would then choose from that IP range to hand out to clients.

5
  • No I am not appending /16 at end. I have given here for subnet indication.
    – User1241
    Jul 10, 2012 at 17:54
  • I had already tried this approach, but I again tried after flushing iptables and following the instructions on your links, does not work. :(
    – User1241
    Jul 10, 2012 at 18:06
  • 1
    @User1241: If you want to use NAT, you need to assign each end of the private link between the two machines a private IP address. For example, you can use 192.168.200.1/24 and 192.168.200.2/24. You will also need to make the private address of the machine doing NAT (the one with both connections) the other one's default gateway and you'll need to set its DNS server IPs manually. Jul 11, 2012 at 13:37
  • @DavidSchwartz Love it! Its working great after making changes as per your comments. Thanks! I have edited your answer and added your comment to it so as to make it the right answer. Thanks.
    – User1241
    Jul 11, 2012 at 14:03
  • @allquixotic Thanks! Your reply got me started.
    – User1241
    Jul 11, 2012 at 14:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .