0

I have a tun0 interface set up which allows packets to be sent as such:

HOST (aaaa::1) ----> tun0 ----> SLIP ----> Router (aaaa::200:0:0:1)

The router receives the packets, and can send back a webpage (it has a small webserver on it), which I can then see in a browser on the host, and in wireshark:

3205    2129.960625056  aaaa::1 aaaa::200:0:0:1 TCP 80  49192 → 80 [SYN] Seq=0 Win=28800 Len=0 MSS=1440 SACK_PERM=1 TSval=579845 TSecr=0 WS=128
3206    2129.977020758  aaaa::200:0:0:1 aaaa::1 TCP 64  80 → 49192 [SYN, ACK] Seq=0 Ack=1 Win=48 Len=0 MSS=48
3207    2129.977056613  aaaa::1 aaaa::200:0:0:1 TCP 60  49192 → 80 [ACK] Seq=1 Ack=1 Win=28800 Len=0

HOWEVER, when I try to do the following:

Router (aaaa::200:0:0:1) ----> SLIP ----> tun0 ----> HOST (aaaa::1)

The host doesn't receive the packets (UDP). I have wireshark set up to capture on tun0, and I can see that the packets make it to the interface...

2164    454.682603267   aaaa::200:0:0:1 aaaa::1 UDP 73  8765 → 5678  Len=25

However, when I use netcat to monitor [aaaa::1]:5678, I can't see any packets arriving.

I'm fairly convinced this is something to do with how the routes and forwarding have been set up on the tun interface, but I don't know enough about it to figure this out.

Here is the output when the tunslip interface is set up:

slip connected to ``127.0.0.1:60001''
opened tun device ``/dev/tun0''
ifconfig tun0 inet `hostname` mtu 1500 up
ifconfig tun0 add aaaa::1/64
ifconfig tun0 add fe80::0:0:0:1/64
ifconfig tun0

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:127.0.1.1  P-t-P:127.0.1.1  Mask:255.255.255.255
          inet6 addr: fe80::1/64 Scope:Link
          inet6 addr: aaaa::1/64 Scope:Global
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

And this is the output from ip route show table local:

broadcast 127.0.0.0 dev lo  proto kernel  scope link  src 127.0.0.1 
local 127.0.0.0/8 dev lo  proto kernel  scope host  src 127.0.0.1 
local 127.0.0.1 dev lo  proto kernel  scope host  src 127.0.0.1 
local 127.0.1.1 dev tun0  proto kernel  scope host  src 127.0.1.1 
broadcast 127.255.255.255 dev lo  proto kernel  scope link  src 127.0.0.1 
broadcast 172.23.0.0 dev wlx0013ef1b001c  proto kernel  scope link  src 172.23.251.64 
local 172.23.251.64 dev wlx0013ef1b001c  proto kernel  scope host  src 172.23.251.64 
broadcast 172.23.255.255 dev wlx0013ef1b001c  proto kernel  scope link  src 172.23.251.64 
David Makogon
  • 2,768
  • 1
  • 20
  • 29
mbadd
  • 101
  • 1

1 Answers1

0

So this is fairly embarrassing, but I had forgotten I had configured a firewall on my host machine, which meant all incoming connections were blocked. Turned off the firewall and everything works as it should.

mbadd
  • 101
  • 1