# add additonal subnet on internal eth0 of router? [solved]

## thoughtform

currently I have an x86 Gentoo router.

eth1 is dynamic, connected to cable modem.

eth0 is statically assigned w/ network 10.21.1.0/24

I would like to add network 192.168.1.0/24 to eth0

The 10.x network will be for my internal clients, their mac addresses are in dhcpd.conf so they get assigned 10.x ip addresses.

unknown clients should get assigned 192.x addresses, and then I will apply a special iptables rule to that network.

I am using iptables,iproute2,arno-iptables-firewall

The last time I added another subnet in /etc/conf.d/net, it broke dhcpd

What is the proper way to set this up?

ThanksLast edited by thoughtform on Sun Jan 16, 2011 11:24 pm; edited 1 time in total

----------

## richard.scott

you should just be able to add it in like this to /etc/conf.d/net

```
config_eth0=(

 "10.21.1.1/24"

 "192.168.1.1/24"

)
```

That should add both 10.21.1.1 and 192.168.1.1 to eth0.

You would then need to add a new range to your /etc/dhcp/dhcpd.conf:

```
...

subnet 192.168.1.0 netmask 255.255.255.0 {

  range 192.168.1.2 192.168.1.254;

  option subnet-mask 255.255.255.0;

  option routers 192.168.1.1;

...
```

Hope that helps.

Rich

----------

## thoughtform

shared-network 224-29 {

  subnet 10.21.1.0 netmask 255.255.255.0 {

    option routers 10.21.1.1;

  }

  subnet 192.168.0.0 netmask 255.255.255.0 {

    option routers 192.168.0.1;

  }

----------

