1834406 Members
1551 Online
110067 Solutions
New Discussion

Default gateway again

 
SOLVED
Go to solution
S Feltrogh
Occasional Contributor

Default gateway again

Just out of curiousity...

If I have a network with an HP WS communicating with 2 other devices (these have their own IP addresses), would having a default gateway on the WS (configured as the same IP as the WS) prevent me pinging the other addresses on the network?
5 REPLIES 5
G. Vrijhoeven
Honored Contributor

Re: Default gateway again

Hi,

Thats possibe but not nesisery.
A default gateway normaly is a router. It is used so the server/workstation is able to communicate with other network devices in other networks. With the command netstat -rn you can view the settings on the unix host. For all the networks not specificly mentioned in the routing table the default gateway will be used. If you configure a defauld gateway that does not exist. All the networks not mentioned in this routing table will be unavailable.

Hope this helps.

Gideon

PS /etc/rc.config.d/netconf file is used at boot time to set a default gateway.
Armin Feller
Honored Contributor

Re: Default gateway again

1. from commandline (after reboot away)

# route add default 132.128.22.9 1

2. Made the above route command permanent by adding it to netconf file
as follows:

ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]=132.128.22.9
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""
John Palmer
Honored Contributor

Re: Default gateway again

Good question! You'd have to try it.

You should still be able to communicate with devices in the same subnet as they wouldn't use the routing table.

I can't think of any possible reason why you'd want to set the default gateway as itself however.

Regards,
John
Ron Kinner
Honored Contributor
Solution

Re: Default gateway again

Actually setting the default gateway to its own address does make sense, won't stop you from talking to local hosts and, strangely enough, in most cases it won't even stop you from reaching distant networks as long as you set the metric to 0.

The way it works is that if the routing table points back to its own gateway with a metric of 0 the box things everything is local and ARPs for the IP address that it wants to reach. Your friendly local router hears the ARP, check's its own routing tables and if it knows how to get to the IP address (or thinks it does) it will send an ARP reply giving its own MAC as the MAC to use to reach the IP address. This is known as Proxy ARP and this service is on by default on most routers but it can be turned off. This is sort of a legacy thing and is not used much any more since it is a bit slower (have to ARP first) than using a default gateway.

Don't know what happens if the metric is set to 1. Never tried it.

The Default gateway is only used for nonlocal connections so it should not matter with local connections. Assuming your NIC is working, what could stop you from talking to other IPs on the same LAN would be having different masks or IPs which are not in the same subnet. Of course, having the same IP address would also mess you up. Other possibilities would be a bad cable, a crossover cable when you need a straight, a speed mismatch between the NIC and the hub/switch, ports in different VLANs or other switch tricks. Look for a link light on both ends of the cable to be sure the cable is good. For HPUX check
lanadmin
lan
display
to see if you have a healthy NIC. Make sure you are looking at the correct one if you have more than one. You should see the speed and duplex and whether HPUX thinks the card is good and working. For MS you can often set it to give you an icon in the systray which will tell you the status and the number of packets going in and out.

Ron
Oleg Zieaev_1
Regular Advisor

Re: Default gateway again

Hello.

One of the reasons you want to set your route to your own IP is for security. However in this case I only head of using localloop address.
In case you have offender network (or IP) you can set route to that network (IP) to be through 127.0.0.1. In this case your IP will go stealth for the network you block.

Having said that I would not set my default gateway to IP of my host, but to IP of the gateway.

Hope this helps,
0leg
Professionals will prevail ...