Два диапазона сети, один шлюз - проблема двойного NAT

5257
Joseph

У меня есть одна сеть 192.168.0.x, которая медленно исчерпывает IP-адреса. Я хотел исправить это, создав вторую сеть для мобильных устройств (192.168.1.x).

Первая сеть имеет шлюз 192.168.0.1 и подсеть 255.255.255.0.

Когда мне нужно было настроить вторую сеть (с использованием Apple Airport), я установил для ее IP-адреса 192.168.0.3, для его подсети - 255.255.255.0, а для маршрутизатора и DNS - 192.168.0.1. Я также активировал DHCP-сервис для диапазона 192.168.1.2 - 200.

Кажется, это работает нормально, хотя я получил сообщение о том, что в сети был «двойной NAT». Кроме того, он сообщает мне: «Эта базовая станция AirPort имеет частный IP-адрес на своем порту Ethernet WAN. Она подключена к устройству или сети, использующей преобразование сетевых адресов для предоставления частных IP-адресов. Измените базовую станцию ​​AirPort на использование DHCP и NAT в режим моста ".

Но если я сделаю это, это не послужит тому, что AirPort будет отдельным DHCP для второго диапазона адресов (192.168.1.x). Могу ли я просто игнорировать эту ошибку, или я делаю что-то не так?

Спасибо

// РЕДАКТИРОВАТЬ

Я также заметил, что если я сейчас пытаюсь что-либо изменить в настройках DHCP или NAT на AirPort, я получаю сообщение об ошибке: «Введенный вами диапазон DHCP конфликтует с IP-адресом WAN вашей базовой станции». Мне предлагается использовать 192.168.0.2-200 в качестве диапазона DHCP, но это не то, что я хотел. Такого рода у меня возникает ощущение, что у меня может не быть правильной настройки, даже если она работает - как я уже говорил.

0

2 ответа на вопрос

2
MariusMatutiae

The message:

There is a "Double NAT" in the network. This AirPort base station has a private IP address on its Ethernet WAN port. It is connected to a device or network that is using Network Address Translation to provide private IP addresses.

is purely a warning message, which you can safely disregard altogether.

The annoying feature of this configuration is that none of the devices on the 192.168.0.0/24 network will be able to talk to those on the 192.168.1.0/24 network. In other words, right now they represent two distinct subnets. You may keep this configuration, if this is of no concern to you.

Alternatively, you may wish to integrate all of your components into a single subnet. You may obtain this in this way (the order of these operations matters):

1.connect to the Airport, and disable DHCP;

2.unplug the ethernet cable from the WAN side of the Airport, and plug it into the LAN side.

3.open the GUI of the main router, and change the mask of the LAN, from 255.255.255.0 to 255.255.254.0.

4.Turn off everything;

5.turn on the router, count to five, turn on all of the devices in whichever order.

By doing this, you will have established a twice-as-large network, with these properties (output of ipcalc):

# ipcalc 192.168.0.0/23 Address: 192.168.0.0 11000000.10101000.0000000 0.00000000 Netmask: 255.255.254.0 = 23 11111111.11111111.1111111 0.00000000 Wildcard: 0.0.1.255 00000000.00000000.0000000 1.11111111 Network: 192.168.0.0/23 11000000.10101000.0000000 0.00000000 HostMin: 192.168.0.1 11000000.10101000.0000000 0.00000001 HostMax: 192.168.1.254 11000000.10101000.0000000 1.11111110 Broadcast: 192.168.1.255 11000000.10101000.0000000 1.11111111 Hosts/Net: 510 Class C, Private Internet 

This way you will have defeated the dearth of IP addresses, while still keeping all of your devices into the same subnet. Turning everything off and on again forces the introduction of the new mask, and the new routing table.

This works provided you do not have static IPs. If instead you do, you will have to manually adjust the mask to reflect its new value, on each device.

`ipcalc` - действительно полезный инструмент. Бросил его в / usr / local / bin на моем компьютере с OS X. Спасибо ~! Trane Francks 9 лет назад 0
1
GdD

There isn't quite enough information on your post, I'm going to assume you have 2 network devices. One is connected to the ISP and the second is the AirPort.

It says you have a double NAT because you do in fact have a double NAT. This isn't generally a problem for standard web traffic, but if you have devices that use UPnP the ones on the inside of the second NAT won't be able to negotiate connections through two levels of firewalls.

The thing is it's completely unnecessary for you to add a second device, if you are running out of IP addresses in your private range then you can easily fix that by simply widening the address range on your primary device. If you change the subnet mask from 255.255.255.0 to 255.255.254.0 you will double the number of IP addresses in that range, and then you don't need to add a second device. You'll need to change the subnet mask on any manually configured network device, but anything that gets it's IP by DHCP will automatically update.

Ваше предположение верно. Интернет -> 192.168.0.x -> Устройства ... и .... Аэропорт (который обрабатывает 192.168.1.x) -> Устройства. Joseph 10 лет назад 0
Что касается решения 255.255.254.0. Мне действительно нравится тот факт, что мобильные устройства (диапазон 192.168.1.x) не могут получить доступ к устройствам в диапазоне 192.168.0.x. Мобильные устройства находятся в некой гостевой сети, которой нужен только стандартный веб-трафик. Маршрутизация извне в 192.168.1.x не требуется. Joseph 10 лет назад 0
Тогда лучший способ сделать это - установить второй диапазон DHCP и использовать мостовое соединение, как предложено. GdD 10 лет назад 0
Аэропорт Apple позволяет мне устанавливать только DHCP, но вынуждает меня перейти в диапазон 192.168.0.x. Joseph 10 лет назад 0
У аэропорта Apple, вероятно, нет гибкости, чтобы делать то, что вы хотите. Есть много продуктов, которые могут сделать мост, я предлагаю вам изучить то, что доступно в вашем регионе. GdD 10 лет назад 0

Похожие вопросы