route print command show almost all On-link gateway - networking

Trying to learn about routing tables, when preforming route print on cmd window I get this result on the IPv4 table:
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.0.0.138 10.0.0.9 50
10.0.0.0 255.255.255.0 On-link 10.0.0.9 306
10.0.0.9 255.255.255.255 On-link 10.0.0.9 306
10.0.0.255 255.255.255.255 On-link 10.0.0.9 306
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 10.0.0.9 306
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 10.0.0.9 306
===========================================================================
From my understanding, the Network Destination and Netmask combine show the Network ID, and Gateway is the "next hop" meaning it is the address where addresses from Network ID can get to the internet, via the Interface on the right.
This table is different from other I seen on line, and almost all the gateways are On-link. From a simple google search, I found those On-link mean addresses reachable locally (my router's address?) so On-link=10.0.0.138 in this example? And since network ID is all 0.0.0.0 that means the only routing available on my system is going to 10.0.0.138 through 10.0.0.9? If so why I need the other rows? If I'm wrong I would love to know better.
Thanks.

"on-link" doesn't equal 10.0.0.138. It means that the destination network is directly attached to the interface - meaning traffic that matches this route entry will trigger an ARP request that should be sent from this link to resolve the destination IP directly (not the gateway 10.0.0.138).
This is also called "glean adjacency".
The 10.0.0.9 route instructs packets with destination IP 10.0.0.9 to be sent to the CPU (AKA punt adjacency).
127.0.0.0/24 network is for internal communication within the machine.
224.0.0.0/4 is for multicast traffic.

Related

squid as http proxy configuration

I am trying to use Squid as http proxy (proxy all requests from 88.99.219.124 using 85.10.219.144/29 subnet).
$ cat /etc/squid3/squid.conf
acl client src 88.99.219.124
acl proxy dst 85.10.219.144/29
http_access allow client proxy
http_access deny all
http_port 3129
$ tail -f /var/log/squid3/access.log
1543865940.128 0 88.99.219.124 TCP_DENIED/403 3486 CONNECT google.com:443 - HIER_NONE/- text/html
1543865940.138 0 88.99.219.124 TCP_DENIED/403 3486 CONNECT google.com:443 - HIER_NONE/- text/html
1543865940.147 0 88.99.219.124 TCP_DENIED/403 3486 CONNECT google.com:443 - HIER_NONE/- text/html
1543865940.156 0 88.99.219.124 TCP_DENIED/403 3486 CONNECT google.com:443 - HIER_NONE/- text/html
Whats wrong with my config?
Squid config:
$ cat /etc/squid3/squid.conf
acl client src 88.99.219.124
http_access allow client
http_access deny all
http_port 3129
debug_options ALL,1
To allow your server to use 85.10.219.144/29 subnet, add ip adresses from subnet to network interfaces.
Use subnet calculator to find min & max ip in subnet range.
Network interfaces:
$ cat /etc/network/interfaces
...
auto vmbr0
iface vmbr0 inet static
address x.x.x.x
netmask x.x.x.x
gateway x.x.x.x
bridge-ports __network_interface_name__
bridge-stp off
bridge-fd 0
auto vmbr0:0
iface vmbr0:0 inet static
address 85.10.219.145
netmask 255.255.255.248
auto vmbr0:1
iface vmbr0:1 inet static
address 85.10.219.146
netmask 255.255.255.248
auto vmbr0:2
iface vmbr0:2 inet static
address 85.10.219.147
netmask 255.255.255.248
auto vmbr0:3
iface vmbr0:3 inet static
address 85.10.219.148
netmask 255.255.255.248
auto vmbr0:4
iface vmbr0:4 inet static
address 85.10.219.149
netmask 255.255.255.248
auto vmbr0:5
iface vmbr0:5 inet static
address 85.10.219.150
netmask 255.255.255.248
And now when we try to use our proxy, it works!
$ curl -x http://85.10.219.150:3129 -L http://google.com
In log file:
$ cat /var/log/squid/access.log
1544717769.941 58 _your_ip_ TCP_MISS/200 13234 GET http://www.google.com/ - HIER_DIRECT/2a00:1450:4001:809::2004 text/html

USB Modem changed IPV4 route table Metric of LAN to 4237 windows 7

I am using two network interfaces (Below).
Scenario 1:
Initially LAN is connected with metric=12 of ipv4 route table.
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.12.1.2 10.12.1.13 12
10.12.1.0 255.255.255.0 On-link 10.12.1.13 262
10.12.1.13 255.255.255.255 On-link 10.12.1.13 262
10.12.1.255 255.255.255.255 On-link 10.12.1.13 262
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 10.12.1.13 262
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 10.12.1.13 262
===========================================================================
LAN ip 10.12.1.13.
When USB Modem gets connected to the system, it changed the LAN metric to 4237. and USB modem gets the metric lower value between 4-10.
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.12.1.2 10.12.1.13 4237
0.0.0.0 0.0.0.0 On-link 101.63.220.237 6
10.12.1.0 255.255.255.0 On-link 10.12.1.13 4487
10.12.1.13 255.255.255.255 On-link 10.12.1.13 4487
10.12.1.255 255.255.255.255 On-link 10.12.1.13 4487
101.63.220.237 255.255.255.255 On-link 101.63.220.237 261
127.0.0.0 255.0.0.0 On-link 127.0.0.1 4531
127.0.0.1 255.255.255.255 On-link 127.0.0.1 4531
127.255.255.255 255.255.255.255 On-link 127.0.0.1 4531
224.0.0.0 240.0.0.0 On-link 127.0.0.1 4531
224.0.0.0 240.0.0.0 On-link 10.12.1.13 4488
224.0.0.0 240.0.0.0 On-link 101.63.220.237 6
255.255.255.255 255.255.255.255 On-link 127.0.0.1 4531
255.255.255.255 255.255.255.255 On-link 10.12.1.13 4487
255.255.255.255 255.255.255.255 On-link 101.63.220.237 261
===========================================================================
LAN IP : 10.12.1.13 4237 (Metric)
USB Modem IP: 101.63.220.237 6 (Metric)
Now the default network interface is USB Modem because it has lowest value of Metric.
Problem: Now my local application is able to connect with default network interface (Metric-6) but cant connect with LAN network interface to access internet (Metric-4237).
Scenario 2:
I changed the metric of LAN from 4237 to 12 (or any value lower value or near value to default network interface), then my local application is able to connect with LAN as well.
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 On-link 101.63.220.237 6
0.0.0.0 0.0.0.0 10.12.1.2 10.12.1.13 12
10.12.1.0 255.255.255.0 On-link 10.12.1.13 262
10.12.1.13 255.255.255.255 On-link 10.12.1.13 262
10.12.1.255 255.255.255.255 On-link 10.12.1.13 262
101.63.220.237 255.255.255.255 On-link 101.63.220.237 261
127.0.0.0 255.0.0.0 On-link 127.0.0.1 4531
127.0.0.1 255.255.255.255 On-link 127.0.0.1 4531
127.255.255.255 255.255.255.255 On-link 127.0.0.1 4531
224.0.0.0 240.0.0.0 On-link 127.0.0.1 4531
224.0.0.0 240.0.0.0 On-link 101.63.220.237 6
224.0.0.0 240.0.0.0 On-link 10.12.1.13 262
255.255.255.255 255.255.255.255 On-link 127.0.0.1 4531
255.255.255.255 255.255.255.255 On-link 101.63.220.237 261
255.255.255.255 255.255.255.255 On-link 10.12.1.13 262
===========================================================================
Persistent Routes:
Queries:
What is metric range (min-max)?
Why application is not able to connect with LAN when its metric value is 4237?
Please suggest the correct way to use metric?

ping localhosts, edit /etc/network/hosts

I want to succesfully ping some hostnames. These hostnames have the same IP, 127.0.0.1
So i edited /etc/network/hosts:
127.0.0.1 host1
127.0.0.1 host2
127.0.0.1 host3
127.0.0.1 host4
127.0.0.1 host5
127.0.0.1 host6
127.0.0.1 host7
127.0.0.1 host8
127.0.0.1 host9
My /etc/network/interfaces file was:
auto lo
iface lo inet loopback
Then i added this:
iface eth0 inet static
address 127.0.0.1
network 127.0.0.0
netmask 255.255.255.0
broadcast 127.0.0.255
But when i try to do:
ping host1
it doesn't work, even with other hostnames in /etc/network/hosts
In the recent kernels the couples hostname-IP are saved in /etc/hosts, not in /etc/network/hosts, the edit in /etc/network/interfaces is useless, i just tried everything

IP destination header in DNS request/reply

When a DNS request/reply is sent to/by a DNS server on another subnet, what IP destination address will be used in the IP header?
DNS is a normal UDP protocol: The real IP-address of the Client-Host and DNS-Server is sent (it will only change if there is a NAT-Service in between).
Example:
Host: 1.1.1.1
NAT-Router-Service: private 1.1.1.2 / public 2.2.2.2
DNS-Server: 3.3.3.3
1. Host: request-packet from 1.1.1.1 to 3.3.3.3
2. NAT-Service: request-packet from 2.2.2.2 to 3.3.3.3
3. DNS-Server: reply-packet from 3.3.3.3 to 2.2.2.2
4. NAT-Service: reply-packet from 3.3.3.3 to 1.1.1.1
Regards Thomas

Access IIS7 with local ip in server 2008 r2?

Strange thing, I have no problem with other two server 2008 r2 and Win7.
I can access to the IIS7 using localhost or 127.0.0.1, but if I try to access this server with it network IP, the IPv4 Address in ipconfig. It doesn't connect to the the IIS7 and gave connection timeout... I tried to turn off the windows firewall, and it still the same...
I wonder what will be the possible problem? The IIS7 was setup with using WebPlatform and is locate inside VMware with using NAT as network setting.
Thanks in advance...
===========
Edit: Route Print and netstat result
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.107.2 192.168.107.129 10
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.107.0 255.255.255.0 On-link 192.168.107.129 266
192.168.107.129 255.255.255.255 On-link 192.168.107.129 266
192.168.107.255 255.255.255.255 On-link 192.168.107.129 266
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.107.129 266
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.107.129 266
===========================================================================
Persistent Routes:
None
IPv6 Route Table
===========================================================================
Active Routes:
If Metric Network Destination Gateway
1 306 ::1/128 On-link
11 266 fe80::/64 On-link
11 266 fe80::db0:f38:6194:3b17/128
On-link
1 306 ff00::/8 On-link
11 266 ff00::/8 On-link
===========================================================================
Persistent Routes:
None
netstat /an | find /i ":80 "
TCP 0.0.0.0:80
0.0.0.0:0 LISTENING TCP [::]:80 [::]:0
LISTENING

Resources