You are not logged in.
I'm setting up a router -- mostly to learn about firewalls and dns. I'm using a computer with 2 NICs setup as internet0 and local0, with internet0 obtaining its IP via DHCP to my ISP-provided router, and local0 being given a static IP. Here are the netctl profiles:
Description='A basic dhcp ethernet connection'
Interface=internet0
Connection=ethernet
IP=dhcpDescription='A basic static ethernet connection'
Interface=local0
Connection=ethernet
IP=static
Address=('10.27.85.1/24')
Gateway='10.27.85.1'
DNS=('10.27.85.1')All is good when I enable ONLY the internet0 connection. I have full access to the Internet. However, when I enable the local0 connection, I get the following:
ping www.google.com
PING www.google.cOM (65.199.32.59) 56(84) bytes of data.
From router (10.27.85.1) icmp_seq=1 Destination Host Unreachable
From router (10.27.85.1) icmp_seq=2 Destination Host Unreachable
From router (10.27.85.1) icmp_seq=3 Destination Host Unreachable
From router (10.27.85.1) icmp_seq=4 Destination Host Unreachable
From router (10.27.85.1) icmp_seq=5 Destination Host Unreachable
From router (10.27.85.1) icmp_seq=6 Destination Host Unreachable
From router (10.27.85.1) icmp_seq=9 Destination Host Unreachable
From router (10.27.85.1) icmp_seq=10 Destination Host Unreachable
From router (10.27.85.1) icmp_seq=11 Destination Host UnreachableIt is clear that the connection seems to default to using the local0 connection first. Is there a means by which I can make sure that connections going outside of the 10.27.85.1/24 subnet go out through internet0? I have enabled nat forwarding and I have a nat table set up in iptables (here are the iptables rules, which I got by following the Simple stateful firewall wiki:
# Generated by iptables-save v1.6.0 on Sat Oct 8 14:21:24 2016
*filter
:INPUT ACCEPT [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [459:46873]
:TCP - [0:0]
:UDP - [0:0]
:fw-interfaces - [0:0]
:fw-open - [0:0]
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate INVALID -j DROP
-A INPUT -p icmp -m icmp --icmp-type 8 -m conntrack --ctstate NEW -j ACCEPT
-A INPUT -p udp -m conntrack --ctstate NEW -j UDP
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m conntrack --ctstate NEW -j TCP
-A INPUT -p tcp -m recent --set --name TCP-PORTSCAN --mask 255.255.255.255 --rsource -j REJECT --reject-with tcp-reset
-A INPUT -p udp -m recent --set --name UDP-PORTSCAN --mask 255.255.255.255 --rsource -j REJECT --reject-with icmp-port-unreachable
-A INPUT -j REJECT --reject-with icmp-proto-unreachable
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -j fw-interfaces
-A FORWARD -j fw-open
-A FORWARD -j REJECT --reject-with icmp-host-unreachable
-A TCP -p tcp -m recent --update --seconds 60 --name TCP-PORTSCAN --mask 255.255.255.255 --rsource -j REJECT --reject-with tcp-reset
-A TCP -s 10.27.85.0/24 -i local0 -p tcp -m tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
-A TCP -p tcp -m tcp --dport 22 -j ACCEPT
-A TCP -s 10.27.85.0/24 -i local0 -p tcp -m tcp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
-A UDP -p udp -m recent --update --seconds 60 --name UDP-PORTSCAN --mask 255.255.255.255 --rsource -j REJECT --reject-with icmp-port-unreachable
-A UDP -s 10.27.85.0/24 -i local0 -p udp -m udp --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
-A UDP -s 10.27.85.0/24 -i local0 -p udp -m udp --dport 67:68 -m state --state NEW,ESTABLISHED -j ACCEPT
-A fw-interfaces -i local0 -j ACCEPT
COMMIT
# Completed on Sat Oct 8 14:21:24 2016
# Generated by iptables-save v1.6.0 on Sat Oct 8 14:21:24 2016
*nat
:PREROUTING ACCEPT [239:23975]
:INPUT ACCEPT [14:1010]
:OUTPUT ACCEPT [27:1897]
:POSTROUTING ACCEPT [27:1897]
-A POSTROUTING -s 10.27.85.0/24 -o internet0 -j MASQUERADE
COMMIT
# Completed on Sat Oct 8 14:21:24 2016
# Generated by iptables-save v1.6.0 on Sat Oct 8 14:21:24 2016
*mangle
:PREROUTING ACCEPT [724:59928]
:INPUT ACCEPT [716:59506]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [469:50093]
:POSTROUTING ACCEPT [469:50093]
COMMIT
# Completed on Sat Oct 8 14:21:24 2016
# Generated by iptables-save v1.6.0 on Sat Oct 8 14:21:24 2016
*raw
:PREROUTING ACCEPT [724:59928]
:OUTPUT ACCEPT [470:50249]
-A PREROUTING -m rpfilter --invert -j DROP
COMMIT
# Completed on Sat Oct 8 14:21:24 2016
# Generated by iptables-save v1.6.0 on Sat Oct 8 14:21:24 2016
*security
:INPUT ACCEPT [417:31786]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [472:50953]
COMMIT
# Completed on Sat Oct 8 14:21:24 2016Any thoughts?
Last edited by ggalt (2016-10-09 16:52:54)
Offline
The issue was that I had the "gateway" parameter set in my local0 netctl profile to the local subnet (10.27.85.1). Deleting this line allows me to connect properly.
Offline