Post by Joe Monk ***@gmail.com [hercules-390]Not sure but I think your subnet mask is wrong on the tun0
interface... shouldn't it be 255.255.255.252?
Don't you need the host machine to be the broadcast for proxy arp? So
shouldn't the tun0 interface be on its own network?
Joe
Nope.
The 255.255.255.255 mask is correct for a Point to Point interface.
If the proper ARP publication is set (via arp -Ds), then any ARP WHOHAS
broadcast request for 192.168.1.123 received on eth0 will be answered,
and a IHAVE ARP response for 192.168.1.123 will be sent with the MAC
address of eth0 to the MAC address of the requester - thus indicating to
any other host on the LAN requesting it on which eth0 is attached that
the MAC address for the host running 192.168.1.123 is the MAC address of
eth0.
When an IP or ICMP datagram is received for 192.168.1.123 over any
interface, it will then be routed to tun0 (if ipv4 forwarding is
enabled) because it has a UH flag and a shorter host mask than any other
route.
When 192.168.1.123 on tun0 emits an IP datagram, it is from a point to
point link, so the IP datagram is just sent to the IP layer (MAC address
is irrelevant on a Point to Point interface), and then routed to the
relevant network interface, the IP routing layer will present the IP
datagram to the relevant network, the MAC address of the output Ethernet
frame (Or whatever link level you are using) will be adjusted to add the
proper source and destination address, the checksum recalculated (unless
the NIC has Checksum offload).
--Ivan
Post by Joe Monk ***@gmail.com [hercules-390]inux-thii:~ #ifconfig
eth0 Link encap:Ethernet HWaddr 74:D4:35:92:91:5E
inet addr:192.168.1.23 Bcast:192.168.1.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:436383 errors:0 dropped:0 overruns:0 frame:0
TX packets:189588 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:193165978 (184.2 Mb) TX bytes:23678368 (22.5 Mb)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:447930 errors:0 dropped:0 overruns:0 frame:0
TX packets:447930 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:111252518 (106.0 Mb) TX bytes:111252518 (106.0 Mb)
tun0 Link encap:UNSPEC HWaddr
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:192.168.1.124 P-t-P:192.168.1.123
Mask:255.255.255.255
UP POINTOPOINT RUNNING MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:224 (224.0 b) TX bytes:2080 (2.0 Kb)
inux-thii:~ #netstat -in
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR
TX-DRP TX-OVR Flg
eth0 1500 0 437747 0 0 0 189986 0
0 0 BMRU
lo 65536 0 449472 0 0 0 449472 0
0 0 LRU
tun0 1500 0 4 0 0 0 24 0
0 0 PRU
inux-thii:~ #netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window
irtt Iface
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0
0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0
0 eth0
192.168.1.123 0.0.0.0 255.255.255.255 UH 0 0
0 tun0
[Non-text portions of this message have been removed]