OpenBSD 4.3 Gateway - Cannot Ping Outside of Subnet
So I decided it is time to learn OpenBSD. I have had my head stuck under Windows and Red Hat Linux for some time. I knew eventually it would come to this. I have a need for a new firewall because I don’t want to pay Astaro for support and maintenance. So I have now installed OpenBSD on two machines and both times I ran into the same issue. I cannot ping outside of the Cox Communications subnet. I can ping items within the subnet such as the Gateway and my other firewall, but I cannot ping anything else including the external DNS server.
Setup
I am hooking my OpenBSD directly to the internet as it is intended to become a firewall. During the installation process, I configured one ethernet card for the external network, gave it an IP Address, and a subnet mask. But I could not see where to place the Gateway value.
The network settings given by the ISP were as follows (values changed to protect the innocent):
IPAddress: 81.147.68.133
Subnet: 255.255.255.128
Gateway: 81.147.68.129
To look at my settings, I went to /etc/myhostname.fxp0 which was the name of the file for configuring the network card on this particular machine. This is what it should have looked like.
INET 81.147.68.133 255.255.255.128 NONE
Since I did not know where to put the Gateway, I originally tried variations such as replacing NONE with the gateway address. However, whenever I tested the network, I was still not able to access or ping the DNS or anything outside of the subnet.
Solution
The gateway needed to be added. The file for the gateway did not exist by default. To add the gateway, I had to create the following file:
/etc/mygate
Inside that file, I added the IP address of the Gateway.
After saving the file, I rebooted the machine and now my access to the external network works properly. I can fully access the internet.
What I finally figured out later is that the Gateway address is one of the parameters that you set during the installation. I must have left it blank while I was going through the installation process. However, they did not call it a gateway. They called it something else.