You are not logged in.

#1 2016-11-18 15:36:20

ouafnico
Member
Registered: 2014-10-30
Posts: 14

Router / Bond

Hi all,

I'm trying to create a little router with dual internet access.

The first internet access (A) is connected to the router (R) on eth0.
The second internet access (B) is connected to the router (R) on wlan0.

I've created a bond (roundrobbin) on the router (R) named bond0. The IP is 192.168.1.254.
The internet access A and B are using the same network (192.168.1.0/24).

The router (R) is connected to the switch LAN on eth1, with IP 192.168.2.1, and GW 192.168.1.254.

Now, I need to access internet trough R on clients computers (C).
IP addresses for clients are provided by dnsmasq on R, listening only on eth1, and giving IP addresses on 192.168.2.0/24 (with gw 192.168.2.1, and good dns).

A --> eth0 --> R
B --> wlan0 --> R
R --> eth1 --> LAN --> C

On netctl, I've created the following configurations:

eth0:

Interface=eth0
Connection=ethernet
IP=no

wlan0:

Interface=wlan0
Connection=wireless
IP=no
ESSID="mysssid for B inernet"
Key="mykey"

bond0:

Interface=bond0
Connection=bond
BindsToInterfaces=(eth0 wlan0)
IP=static
Address="192.168.1.254/24"
Mode=balance-rr

eth1:
Interface=eth1
Connection=ethernet
IP=static
Address="192.168.2.1/24"
Gateway="192.168.1.254"

I have enabled the ip_forward on systctl.
I have made the iptables rule:

iptables -t nat -A POSTROUTING -o bond0 -j MASQUERADE

That's the conf.

The clients are correctly taking IP addresses.
They can ping the eth1, and eth0.
But I don't have internet access.

My questions:
- do I need to enable with netctl, eth0 and wlan0 ?
If I enable eth0, wlan0 and bond0, the startup of bond0 fails and say eth0 and wlan0 are already up. Bond0 stay DOWN.
If I do not enable eth0 and wlan0, bond0 goes UP (and show starting eth0 and wlan0), but the eth0 seems not connected correctly, and wlan0 is not connected (how can he knows the good config for wifi ?)
- do I need to make the iptables rules to bond0 ?

I have tried to ignore bond0, and just connect wlan0 with a static IP. Changing the iptables rule to wlan0 make all work. But I loose the link aggregate which is the principal need smile

Sorry for my english.

If someone can try to help me smile

Thanks a lot,

Offline

Board footer

Powered by FluxBB