Situation:
1. Do you have a router (a separate device) through which several computers in a company goes to the Internet (via a hub). In this case that is a wireless router.2. Router must have a static IP address (eg 192.168.1.1), so that in the event of a server crash some of the clients on the LAN at the company could fix him.
3. Some computers on the LAN do not need to have a static local address, but some do.
4. ISP assigns you a dynamic IP address for the router and computers behind them, if you set them so.
5. Some of computer on LAN need to have, for various reasons, bouth static and dynamic IP. Of course, server is among them.
Why OpenBSD server need to have a dynamic address?
Because in this case server must have indipendent connection to outside world.
You should not be dependent (in office) on just one line to the Internet - must be able for fast switch to another Internet line, with second router, dial up modem or other device (radio, satelite link, etc).
Why server must have a static IP address, other than those provided by the dynamic ISP via DHCP?
To access computer in the local network and reverse, regardless of whether it has or does not have access to the internet.
Why does the router to your ISP has a static IP address?
In case of cancellation of the server, which has a static IP address (alias) and dynamic address given by the ISP, computers that are behind a router on the local network (typically workstations) can access the router and configure router if needed.
If router loses a dynamic address, computers that were behind him will also lose their IP adresses. In order to set up the router, it must be reset to factory setings.
And that can be done just with static adressing.
So, we don't wan't to waste company time, right ?
Note, it is possible for you to have multiple accounts with one (wireless) ISP over just one router. It is important to note that the OpenBSD machines do have just one network card, in this case, and no more. But we need multiple IPs for our OpenBSD server.
How to set up one or more IP addresses on one card ?:
ifconfig fxp0 alias 192.168.1.49 255 255 255 255
Explanation:
ifconfig - this command adjusts the network parameters of the OpenBSD and similar systems
fxp0 - this is the network card on the system
192.168.1.49 - this is the IP address that we want to add 255 255 255 255 - this is the "netmask". Use this IP address when you make IP alias, after "real" IP (192.168.1.49)
For example, let's add one more IP address to NIC:
ifconfig fxp0 alias 192.168.1.23 255.255.255.255
# Ifconfig fxp0
fxp0: flags = 8843 mtu 1500
lladdr 00:00: xx: xx: xx: xx
priority: 0
media AutoSelect Ethernet (100BaseTX full-duplex)
Status: Active
inet6 xxx% fxp0 prefixlen 64 scopeid 0x1
iNet 10x.x01.111.16 netmask 0xffffff00 broadcast 10x.x01.111.255
inet 192.168.1.49 netmask 0xffffff00 broadcast 255,255,255,255
inet 192.168.1.23 netmask 0xffffff00 broadcast 255,255,255,255
Can we ping router now ?
# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=0.751 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.970 ms
--- 192.168.1.1 ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.751/0.860/0.970/0.113 ms
#
As soon as we can ping something, we can manage that thing, right ?
Do we have an exit to the Internet?
# ping google.com
PING google.com (173.194.39.69): 56 data bytes
64 bytes from 173.194.39.69: icmp_seq=1 ttl=52 time=38.831 ms
64 bytes from 173.194.39.69: icmp_seq=2 ttl=52 time=23.956 ms
64 bytes from 173.194.39.69: icmp_seq=3 ttl=52 time=10.524 ms
64 bytes from 173.194.39.69: icmp_seq=4 ttl=52 time=12.198 ms
--- google.com ping statistics ---
5 packets transmitted, 4 packets received, 20.0% packet loss
round-trip min/avg/max/std-dev = 10.524/21.377/38.831/11.328 ms
#
Ok, the system is up.
If you want to assign a permanent IP alias to a network card ?
It is necessary to add this line to /etc/hostname.fxp0 :
inet alias xxx.xxx.xxx.xxx 255.255.255.0
Of course, instead of Xs insert the desired IP address you need.
To delete an alias IP's use the command
# Ifconfig fxp0 delete 192.168.1.23
# Ifconfig fxp0 delete 192.168.1.49
Now you can have a lot of "NICs" at your disposal.
No comments:
Post a Comment