1

Below is my current setup, the main ethernet connection is configured with a static ip and it's working fine. The two other interfaces are connected to different Android hotspots using DHCP. I have also configured routes so that each interface can receive/send traffic independently

Below is my fully working /etc/network/interfaces file

root@poweredge:/etc/network# cat interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp1s0
#iface enp1s0 inet dhcp
iface enp1s0 inet static
        address 192.168.1.212
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1

auto wlx74da388c32d0
iface wlx74da388c32d0 inet dhcp
        wpa-ssid four
        wpa-psk fcac8bd4439859aadf1457463f47f49091acb02895bd5a28914a1fc36969c66d
        post-up ip route add default via 172.16.11.254 table wlx74da388c32d0
        post-up ip rule add from 172.16.11.107 lookup wlx74da388c32d0



auto wlx74da388c32c7
iface wlx74da388c32c7 inet dhcp
        wpa-ssid one
        wpa-psk e629e0873738c638cde76ae81487effb28b0e22c309c9e163996e389a313c14c
        post-up ip route add default via 192.168.43.1 table wlx74da388c32c7
        post-up ip rule add from 192.168.43.209 lookup wlx74da388c32c7

I have confirmed that each interface is working independently by using the following commands

curl --interface wlx74da388c32c7 ifconfig.co
curl --interface wlx74da388c32d0 ifconfig.co
curl --interface enp1s0 ifconfig.co

Each curl command is showing the public IP address of the connection as expected. This is exactly how I want things to work.

However, I am running into issues when I setup a static IP on one of the wireless interfaces. For example when I change interface wlx74da388c32c7 to static IP as below

auto wlx74da388c32c7
iface wlx74da388c32c7 inet static
        address 192.168.43.100
        netmast 255.255.255.0
        gateway 192.168.43.1
        wpa-ssid one
        wpa-psk e629e0873738c638cde76ae81487effb28b0e22c309c9e163996e389a313c14c
        post-up ip route add default via 192.168.43.1 table wlx74da388c32c7
        post-up ip rule add from 192.168.43.100 lookup wlx74da388c32c7

curl just hangs when I try to get a page using any interface.

Below is my rt_tables

root@poweredge:/etc/iproute2# cat rt_tables
#
# reserved values
#
255 local
254 main
253 default
0   unspec
#
# local
#
#1  inr.ruhep
10 wlx74da388c32d0
11 wlx74da388c32c7

and below is my ip a command after setting the static ip on the wlx74da388c32c7 interface

root@poweredge:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:1e:4f:cd:c1:5f brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.212/24 brd 192.168.1.255 scope global enp1s0
       valid_lft forever preferred_lft forever
    inet6 fe80::21e:4fff:fecd:c15f/64 scope link 
       valid_lft forever preferred_lft forever
3: wlx74da388c32c7: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 74:da:38:8c:32:c7 brd ff:ff:ff:ff:ff:ff
    inet 192.168.43.100/24 brd 192.168.43.255 scope global wlx74da388c32c7
       valid_lft forever preferred_lft forever
4: wlx74da388c32d0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 74:da:38:8c:32:d0 brd ff:ff:ff:ff:ff:ff
    inet 172.16.11.107/24 brd 172.16.11.255 scope global wlx74da388c32d0
       valid_lft forever preferred_lft forever

My ip route list when DHCP is being used

root@poweredge:~# ip route list
default via 192.168.1.1 dev enp1s0 onlink 
172.16.11.0/24 dev wlx74da388c32d0 proto kernel scope link src 172.16.11.107 
192.168.1.0/24 dev enp1s0 proto kernel scope link src 192.168.1.212 
192.168.43.0/24 dev wlx74da388c32c7 proto kernel scope link src 192.168.43.209 

My ip rule list when DHCP is being used

root@poweredge:~# ip rule list
0:  from all lookup local 
32764:  from 192.168.43.209 lookup wlx74da388c32c7 
32765:  from 172.16.11.107 lookup wlx74da388c32d0 
32766:  from all lookup main 
32767:  from all lookup default 

Anyone know what I'm doing wrong?

  • @HaukeLaging should I do those when the static ip is set or when DHCP is set? – Arya Jun 22 '18 at 21:48
  • Your ip a output shows that the WLAN interfaces are both down... – Hauke Laging Jun 22 '18 at 22:55
  • @HaukeLaging that happens when I set the static ip – Arya Jun 22 '18 at 23:23
  • So is the problem gone after ip link set up dev wlx74da388c32c7; ip link set up dev wlx74da388c32d0? – Hauke Laging Jun 23 '18 at 11:07
0

in your ouput for ip rule list you have the ip 192.168.43.209 this ip does not match with 192.168.43.100 .

To simplify your routing table , you can change to :

post-up ip rule add from 192.168.43.0/24 lookup wlx74da388c32c7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.